hexsha stringlengths 40 40 | size int64 19 11.4M | ext stringclasses 13
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 270 | max_stars_repo_name stringlengths 5 110 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 9 | max_stars_count float64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 270 | max_issues_repo_name stringlengths 5 116 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 9 | max_issues_count float64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 270 | max_forks_repo_name stringlengths 5 116 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 9 | max_forks_count float64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 19 11.4M | avg_line_length float64 1.93 229k | max_line_length int64 12 688k | alphanum_fraction float64 0.07 0.99 | matches listlengths 1 10 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
026f2fd789a41f9561e612149e980d6e7dc664e6 | 956 | cpp | C++ | sturm_mex.cpp | jonathanventura/polynomial | ab737843199ed48881da6dcf5dc05d34903af059 | [
"Unlicense"
] | 16 | 2017-04-28T11:46:50.000Z | 2021-10-01T11:41:00.000Z | sturm_mex.cpp | jonathanventura/polynomial | ab737843199ed48881da6dcf5dc05d34903af059 | [
"Unlicense"
] | 1 | 2018-08-14T00:31:47.000Z | 2018-08-14T00:31:47.000Z | sturm_mex.cpp | jonathanventura/polynomial | ab737843199ed48881da6dcf5dc05d34903af059 | [
"Unlicense"
] | 11 | 2016-02-27T11:37:01.000Z | 2022-02-08T05:58:18.000Z | #include "mex.h"
#include "Polynomial/Polynomial.hpp"
void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
if ( nlhs != 1 || nrhs != 3 )
{
mexErrMsgTxt("usage: roots = sturm_mex(coeffs,lb,ub)");
}
int m = mxGetM(prhs[0]);
int n = mxGetN(prhs[0]);
if ( m != 1 )
{
mexErrMsgTxt("input must be of size [1 n+1] for polynomial of degree n");
}
double lb = mxGetScalar(prhs[1]);
double ub = mxGetScalar(prhs[2]);
double *coeffs = (double*)mxGetData(prhs[0]);
Eigen::VectorXd coef(n);
for ( int i = 0; i < n; i++ ) coef[i] = coeffs[i];
Polynomial::Polynomial<Eigen::Dynamic> poly(coef);
std::vector<double> real_roots;
poly.realRootsSturm(lb,ub,real_roots);
plhs[0] = mxCreateDoubleMatrix(1,real_roots.size(),mxREAL);
double *roots = (double*)mxGetData(plhs[0]);
for ( int i = 0; i < real_roots.size(); i++ ) roots[i] = real_roots[i];
}
| 32.965517 | 81 | 0.600418 | [
"vector"
] |
0276204410e0f8a0c525821060e02c03cece8927 | 7,029 | hpp | C++ | src/tools/rest-backend/model_user.hpp | mirunix/libelektra | a808874567b2c0c823f7619fa72078d89802bca1 | [
"BSD-3-Clause"
] | null | null | null | src/tools/rest-backend/model_user.hpp | mirunix/libelektra | a808874567b2c0c823f7619fa72078d89802bca1 | [
"BSD-3-Clause"
] | 1 | 2019-06-25T11:54:12.000Z | 2019-06-25T11:54:12.000Z | src/tools/rest-backend/model_user.hpp | mirunix/libelektra | a808874567b2c0c823f7619fa72078d89802bca1 | [
"BSD-3-Clause"
] | 1 | 2021-07-06T18:09:20.000Z | 2021-07-06T18:09:20.000Z | /**
* @file
*
* @brief model for user
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*/
#ifndef ELEKTRA_REST_MODEL_USER_HPP
#define ELEKTRA_REST_MODEL_USER_HPP
#include <map>
#include <string>
#include <utility>
#include <boost/algorithm/string/compare.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <config.hpp>
#include <exceptions.hpp>
#include <kdb_includes.hpp>
/**
* @brief main namespace for the REST service
*/
namespace kdbrest
{
/**
* @brief namespace for models
*/
namespace model
{
/**
* @brief model class for a REST service user
*
* this class encapsulates all information that belongs to a user.
*/
class User : public kdb::Key
{
public:
/**
* @brief constructs an User object based on a kdb::Key object
*
* @param key A kdb::Key object
*/
User (const kdb::Key & k) : kdb::Key (k)
{
}
/**
* @brief constructs an User object based on a username
*
* It implicitely constructs a kdb::Key object by super().
* Adds the base user repository path to the username, so it
* is a valid key to be use with KDB.
*
* @param username The username to be used for the key
*/
User (const std::string username)
: kdb::Key (Config::instance ().getConfig ().get<std::string> ("kdb.path.users") + std::string ("/") + username, KEY_END)
{
}
/**
* @brief attempts to add a key as subkey of the entry
*
* If the secure flag is set, does check if the given
* key is really a sub key. If not, nothing is added.
*
* @param key The key do be added as sub key
* @param secure Whether to check if @p k is real subkey
*/
void addSubkey (kdb::Key k, bool secure = false)
{
if (!secure || k.isBelow (static_cast<kdb::Key &> (*this)))
{
m_subkeys.append (k);
}
}
/**
* @brief getter for the kdb::KeySet containing all added sub keys
*
* Returned will be a reference. That means changes to the
* subkeys keyset will affect the user. This allows for
* removal of subkeys.
*
* @return kdb::KeySet with all sub keys
*/
kdb::KeySet & getSubkeys ()
{
return this->m_subkeys;
}
/**
* @brief getter for a sub key by name
*
* If no sub key with the given name exists, an exception
* will be thrown.
*
* @param name The name of the sub key to look for
* @return The requested sub key
* @throws kdbrest::exception::SubkeyNotFoundException
*/
kdb::Key getSubkey (const std::string name) const
{
for (auto elem : this->m_subkeys)
{
if (elem.getName ().compare (this->getName () + std::string ("/") + name) == 0)
{
return elem;
}
}
throw kdbrest::exception::SubkeyNotFoundException ();
}
/**
* @brief getter for the username
*
* @return Username as string
*/
std::string getUsername () const
{
return this->getName ().erase (0, Config::instance ().getConfig ().get<std::string> ("kdb.path.users").length () + 1);
}
/**
* @brief setter for the password hash
*
* @param passwordHash Password hash as string
*/
void setPasswordHash (std::string passwordHash)
{
this->set (passwordHash);
}
/**
* @brief getter for the password hash
*
* @return Password hash as string
*/
std::string getPasswordHash () const
{
return this->get<std::string> ();
}
/**
* @brief setter for the email
*
* @param email Email as string
*/
void setEmail (std::string email)
{
kdb::Key k;
try
{
k = this->getSubkey (ELEKTRA_REST_MODEL_USER_META_EMAIL);
}
catch (kdbrest::exception::SubkeyNotFoundException const & e)
{
k.setName (this->getName () + std::string ("/") + ELEKTRA_REST_MODEL_USER_META_EMAIL);
}
k.set<std::string> (email);
this->addSubkey (k);
}
/**
* @brief getter for the email
*
* @return Email as string
*/
std::string getEmail () const
{
try
{
kdb::Key k = this->getSubkey (ELEKTRA_REST_MODEL_USER_META_EMAIL);
return k.get<std::string> ();
}
catch (kdbrest::exception::SubkeyNotFoundException const & e)
{
return "";
}
}
/**
* @brief setter for the rank
*
* The rank may be anything between (including)
* ELEKTRA_REST_USER_MIN_RANK and
* ELEKTRA_REST_USER_MAX_RANK
*
* @param rank Rank as integer
*/
void setRank (int rank)
{
kdb::Key k;
try
{
k = this->getSubkey (ELEKTRA_REST_MODEL_USER_META_RANK);
}
catch (kdbrest::exception::SubkeyNotFoundException const & e)
{
k.setName (this->getName () + std::string ("/") + ELEKTRA_REST_MODEL_USER_META_RANK);
}
k.set<int> (rank);
this->addSubkey (k);
}
/**
* @brief getter for the rank
*
* If no rank is set yet, the default rank for users
* will be returned.
*
* @return Rank as integer
*/
int getRank () const
{
try
{
kdb::Key k = this->getSubkey (ELEKTRA_REST_MODEL_USER_META_RANK);
return k.get<int> ();
}
catch (kdbrest::exception::SubkeyNotFoundException const & e)
{
return Config::instance ().getConfig ().get<int> ("permissions.rank.default"); // default is user rank
}
}
/**
* @brief setter for the creation date
*
* @param created_at Timestamp when the user has been created
*/
void setCreatedAt (const long created_at)
{
kdb::Key k;
try
{
k = this->getSubkey (ELEKTRA_REST_MODEL_USER_META_CREATEDAT);
}
catch (kdbrest::exception::SubkeyNotFoundException const & e)
{
k.setName (this->getName () + std::string ("/") + ELEKTRA_REST_MODEL_USER_META_CREATEDAT);
}
k.set<long> (created_at);
this->addSubkey (k);
}
/**
* @brief getter for the creation date
*
* @return Timestamp when the user has been created
*/
long getCreatedAt () const
{
try
{
kdb::Key k = this->getSubkey (ELEKTRA_REST_MODEL_USER_META_CREATEDAT);
return k.get<long> ();
}
catch (kdbrest::exception::SubkeyNotFoundException const & e)
{
return 0;
}
}
/**
* @brief compares two users based on their username
*
* @param l left user
* @param r right user
* @return true if the username of l < r
*/
static bool less_than_username (User & l, User & r)
{
return boost::lexicographical_compare (l.getUsername (), r.getUsername (), boost::is_iless ());
}
/**
* @brief compares two users based on their email
*
* @param l left user
* @param r right user
* @return true if the email of l < r
*/
static bool less_than_email (User & l, User & r)
{
return boost::lexicographical_compare (l.getEmail (), r.getEmail (), boost::is_iless ());
}
/**
* @brief compares two users based on their creation date
*
* @param l left user
* @param r right user
* @return true if the creation date of l < r
*/
static bool less_than_created_at (User & l, User & r)
{
return l.getCreatedAt () <= r.getCreatedAt ();
}
/**
* @brief compares two users based on their rank
*
* @param l left user
* @param r right user
* @return true if the rank of l < r
*/
static bool less_than_rank (User & l, User & r)
{
return l.getRank () <= r.getRank ();
}
private:
kdb::KeySet m_subkeys;
};
} // namespace model
} // namespace kdbrest
#endif
| 21.429878 | 122 | 0.650021 | [
"object",
"model"
] |
0277bb2839a6cb0f3b985fd63010f770d8dbf7f5 | 3,126 | cpp | C++ | toonz/sources/stdfx/solarizefx.cpp | ss23/opentoonz | b42e43d4b8d9fedc26022d145218b9a147a30985 | [
"BSD-3-Clause"
] | null | null | null | toonz/sources/stdfx/solarizefx.cpp | ss23/opentoonz | b42e43d4b8d9fedc26022d145218b9a147a30985 | [
"BSD-3-Clause"
] | null | null | null | toonz/sources/stdfx/solarizefx.cpp | ss23/opentoonz | b42e43d4b8d9fedc26022d145218b9a147a30985 | [
"BSD-3-Clause"
] | 1 | 2019-10-07T17:12:30.000Z | 2019-10-07T17:12:30.000Z |
#include "texception.h"
#include "tfxparam.h"
#include "stdfx.h"
namespace
{
template <typename T, typename PIXEL>
void prepare_lut(double max, int edge, std::vector<T> &lut)
{
double aux = (double)PIXEL::maxChannelValue;
int i = 0;
for (i = 0; i <= edge; i++) {
lut[i] = (int)((max / edge) * i);
}
for (i = edge + 1; i < PIXEL::maxChannelValue + 1; i++) {
lut[i] = (int)((max / (edge - aux)) * (i - aux));
}
}
}
//===================================================================
class SolarizeFx : public TStandardRasterFx
{
FX_PLUGIN_DECLARATION(SolarizeFx)
TRasterFxPort m_input;
TDoubleParamP m_maximum;
TDoubleParamP m_edge;
public:
SolarizeFx()
: m_maximum(1.0), m_edge(128.0)
{
bindParam(this, "maximum", m_maximum);
bindParam(this, "peak_edge", m_edge);
addInputPort("Source", m_input);
//m_value->setValueRange(0, std::numeric_limits<double>::max());
m_maximum->setValueRange(0.0, 10.0);
m_edge->setValueRange(0.0, 255.0);
}
~SolarizeFx(){};
bool doGetBBox(double frame, TRectD &bBox, const TRenderSettings &info)
{
if (m_input.isConnected()) {
bool ret = m_input->doGetBBox(frame, bBox, info);
return ret;
} else {
bBox = TRectD();
return false;
}
}
void doCompute(TTile &tile, double frame, const TRenderSettings &ri);
bool canHandle(const TRenderSettings &info, double frame) { return true; }
};
namespace
{
template <typename T>
void update_param(T ¶m, TRaster32P ras)
{
return;
}
template <typename T>
void update_param(T ¶m, TRaster64P ras)
{
param = param * 257;
return;
}
}
//-------------------------------------------------------------------
template <typename PIXEL, typename CHANNEL_TYPE>
void doSolarize(TRasterPT<PIXEL> ras, double max, int edge)
{
std::vector<CHANNEL_TYPE> solarize_lut(PIXEL::maxChannelValue + 1);
update_param(max, ras);
update_param(edge, ras);
prepare_lut<CHANNEL_TYPE, PIXEL>(max, edge, solarize_lut);
int j;
ras->lock();
for (j = 0; j < ras->getLy(); j++) {
PIXEL *pix = ras->pixels(j);
PIXEL *endPix = pix + ras->getLx();
while (pix < endPix) {
pix->r = (CHANNEL_TYPE)(solarize_lut[(int)(pix->r)]);
pix->g = (CHANNEL_TYPE)(solarize_lut[(int)(pix->g)]);
pix->b = (CHANNEL_TYPE)(solarize_lut[(int)(pix->b)]);
*pix++;
}
}
ras->unlock();
}
//-------------------------------------------------------------------
void SolarizeFx::doCompute(TTile &tile, double frame, const TRenderSettings &ri)
{
if (!m_input.isConnected())
return;
m_input->compute(tile, frame, ri);
double min, max, step;
m_maximum->getValueRange(min, max, step);
double maxValue = 128 * tcrop(m_maximum->getValue(frame), min, max);
m_edge->getValueRange(min, max, step);
int edge = (int)tcrop(m_edge->getValue(frame), min, max);
TRaster32P raster32 = tile.getRaster();
if (raster32)
doSolarize<TPixel32, UCHAR>(raster32, maxValue, edge);
else {
TRaster64P raster64 = tile.getRaster();
if (raster64)
doSolarize<TPixel64, USHORT>(raster64, maxValue, edge);
else
throw TException("SolarizeFx: unsupported Pixel Type");
}
}
FX_PLUGIN_IDENTIFIER(SolarizeFx, "solarizeFx");
| 23.503759 | 80 | 0.631478 | [
"vector"
] |
027d29a779a2c2969627ff87aa213fc9bedf4253 | 704 | hpp | C++ | src/render/types.hpp | JacobDomagala/Shady | cdb8b07a83d179f58bd70c42957e987ddd201eb4 | [
"MIT"
] | 2 | 2020-10-27T00:16:18.000Z | 2021-03-29T12:59:48.000Z | src/render/types.hpp | JacobDomagala/DEngine | cdb8b07a83d179f58bd70c42957e987ddd201eb4 | [
"MIT"
] | 58 | 2020-08-23T21:38:21.000Z | 2021-08-05T16:12:31.000Z | src/render/types.hpp | JacobDomagala/Shady | cdb8b07a83d179f58bd70c42957e987ddd201eb4 | [
"MIT"
] | null | null | null | #pragma once
#include <array>
#include <string>
#include <glm/glm.hpp>
namespace shady::render {
enum class TextureType
{
DIFFUSE_MAP = 0,
SPECULAR_MAP = 1,
NORMAL_MAP = 2,
CUBE_MAP = 3
};
struct UniformBufferObject
{
glm::mat4 proj = {};
glm::mat4 view = {};
glm::mat4 lightView = {};
};
struct DebugData
{
uint32_t displayDebugTarget = 0;
int32_t pcfShadow = 1;
float ambientLight = 0.1f;
float shadowFactor = 0.1f;
};
struct PerInstanceBuffer
{
glm::mat4 model = {};
glm::vec4 textures = {};
};
// DIFFUSE_MAP SPECULAR_MAP NORMAL_MAP
using TextureMaps = std::array< std::string, 3 >;
} // namespace shady::render
| 16.761905 | 50 | 0.617898 | [
"render",
"model"
] |
028354f3dea8a7dee2d0c7c044468cab9c77dbc3 | 211 | cc | C++ | src/function.cc | shangjiaxuan/Kagami | 6e6013b1ad2ebdf4b67162929fd2cd19c61635e3 | [
"BSD-2-Clause"
] | null | null | null | src/function.cc | shangjiaxuan/Kagami | 6e6013b1ad2ebdf4b67162929fd2cd19c61635e3 | [
"BSD-2-Clause"
] | null | null | null | src/function.cc | shangjiaxuan/Kagami | 6e6013b1ad2ebdf4b67162929fd2cd19c61635e3 | [
"BSD-2-Clause"
] | null | null | null | #include "function.h"
namespace kagami {
Message MakeInvokePoint(string id, string type_id) {
vector<string> arg = { id,type_id };
return Message(kCodeInterface, util::CombineStringVector(arg));
}
} | 26.375 | 67 | 0.71564 | [
"vector"
] |
0288a06be30288de64fdfc26c52d429ccb398c38 | 2,580 | cpp | C++ | cvc3/src/theory_simulate/simulate_theorem_producer.cpp | kencheung/js-symbolic-executor | 18266513cc9bc885434890c8612aa26f0e2eab8b | [
"Apache-2.0"
] | 5 | 2015-10-11T08:32:50.000Z | 2019-02-01T22:59:18.000Z | cvc3/src/theory_simulate/simulate_theorem_producer.cpp | kencheung/js-symbolic-executor | 18266513cc9bc885434890c8612aa26f0e2eab8b | [
"Apache-2.0"
] | null | null | null | cvc3/src/theory_simulate/simulate_theorem_producer.cpp | kencheung/js-symbolic-executor | 18266513cc9bc885434890c8612aa26f0e2eab8b | [
"Apache-2.0"
] | null | null | null | /*****************************************************************************/
/*!
*\file simulate_theorem_producer.cpp
*\brief Trusted implementation of the proof rules for symbolic simulator
*
* Author: Sergey Berezin
*
* Created: Tue Oct 7 10:55:24 2003
*
* <hr>
*
* License to use, copy, modify, sell and/or distribute this software
* and its documentation for any purpose is hereby granted without
* royalty, subject to the terms and conditions defined in the \ref
* LICENSE file provided with this distribution.
*
* <hr>
*
*/
/*****************************************************************************/
// This code is trusted
#define _CVC3_TRUSTED_
#include <algorithm>
#include "simulate_theorem_producer.h"
#include "theory_simulate.h"
#include "theory_core.h"
using namespace std;
using namespace CVC3;
////////////////////////////////////////////////////////////////////
// TheoryArith: trusted method for creating ArithTheoremProducer
////////////////////////////////////////////////////////////////////
SimulateProofRules* TheorySimulate::createProofRules() {
return new SimulateTheoremProducer(theoryCore()->getTM());
}
////////////////////////////////////////////////////////////////////
// Proof rules
////////////////////////////////////////////////////////////////////
Theorem SimulateTheoremProducer::expandSimulate(const Expr& e) {
const int arity = e.arity();
if (CHECK_PROOFS) {
CHECK_SOUND(e.getKind() == SIMULATE,
"SimulateTheoremProducer::expandSimulate: "
"expected SIMULATE expression: "
+e.toString());
CHECK_SOUND(arity >= 3 && e[arity - 1].isRational() &&
e[arity - 1].getRational().isInteger(),
"SimulateTheoremProducer::expandSimulate: "
"incorrect children in SIMULATE: " + e.toString());
}
int n = e[arity - 1].getRational().getInt();
if(CHECK_PROOFS) {
CHECK_SOUND(n >= 0, "SimulateTheoremProducer::expandSimulate: "
"Requested negative number of iterations: "+int2string(n));
}
// Compute f(f(...f(f(s0, I1(0), I2(0), ...), I1(1), ...), ... ),
// I1(n-1), ...)
//
// We do this by accumulating the expression in 'res':
// res_{i+1} = func(res_i, I1(i), ..., Ik(i))
Expr res(e[1]);
for(int i=0; i<n; ++i) {
vector<Expr> args;
args.push_back(res);
Expr ri(d_em->newRatExpr(i));
for(int j=2; j<arity-1; ++j)
args.push_back(Expr(e[j].mkOp(), ri));
res = Expr(e[0].mkOp(), args);
}
Proof pf;
if(withProof())
pf = newPf("expand_simulate", e);
return newRWTheorem(e, res, Assumptions::emptyAssump(), pf);
}
| 30 | 79 | 0.551163 | [
"vector"
] |
028922be1eb1f97bbd49da07c3c873957943fc12 | 15,514 | cc | C++ | xdelta-3.0.11/xdelta3/examples/checksum_test.cc | initbithq/xdelta-async | 0ce2fb019675d37a0997c2dde423a4114413eddb | [
"Apache-2.0"
] | 1 | 2019-08-07T06:13:15.000Z | 2019-08-07T06:13:15.000Z | depends/xdelta/3.0.6/examples/checksum_test.cc | ProtocolONE/cord.game-downloader | 90950019937cd2974801ca2f53ed3b4ecd1d219b | [
"Apache-2.0"
] | null | null | null | depends/xdelta/3.0.6/examples/checksum_test.cc | ProtocolONE/cord.game-downloader | 90950019937cd2974801ca2f53ed3b4ecd1d219b | [
"Apache-2.0"
] | null | null | null | /* Copyright (C) 2007 Josh MacDonald */
extern "C" {
#include "test.h"
#include <assert.h>
}
#include <list>
#include <vector>
#include <map>
#include <algorithm>
using std::list;
using std::map;
using std::vector;
// MLCG parameters
// a, a*
uint32_t good_32bit_values[] = {
1597334677U, // ...
741103597U, 887987685U,
};
// a, a*
uint64_t good_64bit_values[] = {
1181783497276652981ULL, 4292484099903637661ULL,
7664345821815920749ULL, // ...
};
struct true_type { };
struct false_type { };
template <typename Word>
int bitsof();
template<>
int bitsof<uint32_t>() {
return 32;
}
template<>
int bitsof<uint64_t>() {
return 64;
}
struct plain {
int operator()(const uint8_t &c) {
return c;
}
};
template <typename Word>
struct hhash { // take "h" of the high-bits as a hash value for this
// checksum, which are the most "distant" in terms of the
// spectral test for the rabin_karp MLCG. For short windows,
// the high bits aren't enough, XOR "mask" worth of these in.
Word operator()(const Word& t, const int &h, const int &mask) {
return (t >> h) ^ (t & mask);
}
};
template <typename Word>
Word good_word();
template<>
uint32_t good_word<uint32_t>() {
return good_32bit_values[0];
}
template<>
uint64_t good_word<uint64_t>() {
return good_64bit_values[0];
}
// CLASSES
#define SELF Word, CksumSize, CksumSkip, Permute, Hash, Compaction
#define MEMBER template <typename Word, \
int CksumSize, \
int CksumSkip, \
typename Permute, \
typename Hash, \
int Compaction>
MEMBER
struct cksum_params {
typedef Word word_type;
typedef Permute permute_type;
typedef Hash hash_type;
enum { cksum_size = CksumSize,
cksum_skip = CksumSkip,
compaction = Compaction,
};
};
MEMBER
struct rabin_karp {
typedef Word word_type;
typedef Permute permute_type;
typedef Hash hash_type;
enum { cksum_size = CksumSize,
cksum_skip = CksumSkip,
compaction = Compaction,
};
// (a^cksum_size-1 c_0) + (a^cksum_size-2 c_1) ...
rabin_karp() {
multiplier = good_word<Word>();
powers = new Word[cksum_size];
powers[cksum_size - 1] = 1;
for (int i = cksum_size - 2; i >= 0; i--) {
powers[i] = powers[i + 1] * multiplier;
}
product = powers[0] * multiplier;
}
~rabin_karp() {
delete [] powers;
}
Word step(const uint8_t *ptr) {
Word h = 0;
for (int i = 0; i < cksum_size; i++) {
h += permute_type()(ptr[i]) * powers[i];
}
return h;
}
Word state0(const uint8_t *ptr) {
incr_state = step(ptr);
return incr_state;
}
Word incr(const uint8_t *ptr) {
incr_state = multiplier * incr_state -
product * permute_type()(ptr[-1]) +
permute_type()(ptr[cksum_size - 1]);
return incr_state;
}
Word *powers;
Word product;
Word multiplier;
Word incr_state;
};
MEMBER
struct adler32_cksum {
typedef Word word_type;
typedef Permute permute_type;
typedef Hash hash_type;
enum { cksum_size = CksumSize,
cksum_skip = CksumSkip,
compaction = Compaction,
};
Word step(const uint8_t *ptr) {
return xd3_lcksum (ptr, cksum_size);
}
Word state0(const uint8_t *ptr) {
incr_state = step(ptr);
return incr_state;
}
Word incr(const uint8_t *ptr) {
incr_state = xd3_large_cksum_update (incr_state, ptr - 1, cksum_size);
return incr_state;
}
Word incr_state;
};
// TESTS
template <typename Word>
struct file_stats {
typedef list<const uint8_t*> ptr_list;
typedef Word word_type;
typedef map<word_type, ptr_list> table_type;
typedef typename table_type::iterator table_iterator;
typedef typename ptr_list::iterator ptr_iterator;
int cksum_size;
int cksum_skip;
int unique;
int unique_values;
int count;
table_type table;
file_stats(int size, int skip)
: cksum_size(size),
cksum_skip(skip),
unique(0),
unique_values(0),
count(0) {
}
void reset() {
unique = 0;
unique_values = 0;
count = 0;
table.clear();
}
void update(const word_type &word, const uint8_t *ptr) {
table_iterator t_i = table.find(word);
count++;
if (t_i == table.end()) {
table.insert(make_pair(word, ptr_list()));
}
ptr_list &pl = table[word];
for (ptr_iterator p_i = pl.begin();
p_i != pl.end();
++p_i) {
if (memcmp(*p_i, ptr, cksum_size) == 0) {
return;
}
}
unique++;
pl.push_back(ptr);
}
void freeze() {
unique_values = table.size();
table.clear();
}
};
struct test_result_base;
static vector<test_result_base*> all_tests;
struct test_result_base {
virtual ~test_result_base() {
}
virtual void reset() = 0;
virtual void print() = 0;
virtual void get(const uint8_t* buf, const int buf_size, int iters) = 0;
virtual void stat() = 0;
virtual int count() = 0;
virtual int dups() = 0;
virtual double uniqueness() = 0;
virtual double fullness() = 0;
virtual double collisions() = 0;
virtual double coverage() = 0;
virtual double compression() = 0;
virtual double time() = 0;
virtual double score() = 0;
virtual void set_score(double min_dups_frac, double min_time) = 0;
virtual double total_time() = 0;
virtual int total_count() = 0;
virtual int total_dups() = 0;
};
struct compare_h {
bool operator()(test_result_base *a,
test_result_base *b) {
return a->score() < b->score();
}
};
MEMBER
struct test_result : public test_result_base {
typedef Word word_type;
typedef Permute permute_type;
typedef Hash hash_type;
enum { cksum_size = CksumSize,
cksum_skip = CksumSkip,
compaction = Compaction,
};
const char *test_name;
file_stats<Word> fstats;
int test_size;
int n_steps;
int n_incrs;
int s_bits;
int s_mask;
int t_entries;
int h_bits;
int h_buckets_full;
double h_score;
char *hash_table;
long accum_millis;
int accum_iters;
// These are not reset
double accum_time;
int accum_count;
int accum_dups;
int accum_colls;
int accum_size;
test_result(const char *name)
: test_name(name),
fstats(cksum_size, cksum_skip),
hash_table(NULL),
accum_millis(0),
accum_iters(0),
accum_time(0.0),
accum_count(0),
accum_dups(0),
accum_colls(0),
accum_size(0) {
all_tests.push_back(this);
}
~test_result() {
reset();
}
void reset() {
// size of file
test_size = -1;
// count
n_steps = -1;
n_incrs = -1;
// four values used by new_table()/summarize_table()
s_bits = -1;
s_mask = -1;
t_entries = -1;
h_bits = -1;
h_buckets_full = -1;
accum_millis = 0;
accum_iters = 0;
fstats.reset();
// temporary
if (hash_table) {
delete(hash_table);
hash_table = NULL;
}
}
int count() {
if (cksum_skip == 1) {
return n_incrs;
} else {
return n_steps;
}
}
int dups() {
return fstats.count - fstats.unique;
}
int colls() {
return fstats.unique - fstats.unique_values;
}
double uniqueness() {
return 1.0 - (double) dups() / count();
}
double fullness() {
return (double) h_buckets_full / (1 << h_bits);
}
double collisions() {
return (double) colls() / fstats.unique;
}
double coverage() {
return (double) h_buckets_full / uniqueness() / count();
}
double compression() {
return 1.0 - coverage();
}
double time() {
return (double) accum_millis / accum_iters;
}
double score() {
return h_score;
}
void set_score(double min_compression, double min_time) {
h_score = (compression() - 0.99 * min_compression)
* (time() - 0.99 * min_time);
}
double total_time() {
return accum_time;
}
int total_count() {
return accum_count;
}
int total_dups() {
return accum_dups;
}
int total_colls() {
return accum_dups;
}
void stat() {
accum_time += time();
accum_count += count();
accum_dups += dups();
accum_colls += colls();
accum_size += test_size;
}
void print() {
if (fstats.count != count()) {
fprintf(stderr, "internal error: %d != %d\n", fstats.count, count());
abort();
}
printf("%s: (%u#%u) count %u uniq %0.2f%% full %u (%0.4f%% coll %0.4f%%) covers %0.2f%% w/ 2^%d @ %.4f MB/s %u iters\n",
test_name,
cksum_size,
cksum_skip,
count(),
100.0 * uniqueness(),
h_buckets_full,
100.0 * fullness(),
100.0 * collisions(),
100.0 * coverage(),
h_bits,
0.001 * accum_iters * test_size / accum_millis,
accum_iters);
}
int size_log2 (int slots)
{
int bits = bitsof<word_type>() - 1;
int i;
for (i = 3; i <= bits; i += 1) {
if (slots <= (1 << i)) {
return i - compaction;
}
}
return bits;
}
void new_table(int entries) {
t_entries = entries;
h_bits = size_log2(entries);
int n = 1 << h_bits;
s_bits = bitsof<word_type>() - h_bits;
s_mask = n - 1;
hash_table = new char[n / 8];
memset(hash_table, 0, n / 8);
}
int get_table_bit(int i) {
return hash_table[i/8] & (1 << i%8);
}
int set_table_bit(int i) {
return hash_table[i/8] |= (1 << i%8);
}
void summarize_table() {
int n = 1 << h_bits;
int f = 0;
for (int i = 0; i < n; i++) {
if (get_table_bit(i)) {
f++;
}
}
h_buckets_full = f;
}
void get(const uint8_t* buf, const int buf_size, int test_iters) {
rabin_karp<SELF> test;
//adler32_cksum<SELF> test;
hash_type hash;
const uint8_t *ptr;
const uint8_t *end;
int last_offset;
int periods;
int stop;
test_size = buf_size;
last_offset = buf_size - cksum_size;
if (last_offset < 0) {
periods = 0;
n_steps = 0;
n_incrs = 0;
stop = -cksum_size;
} else {
periods = last_offset / cksum_skip;
n_steps = periods + 1;
n_incrs = last_offset + 1;
stop = last_offset - (periods + 1) * cksum_skip;
}
// Compute file stats once.
if (fstats.unique_values == 0) {
if (cksum_skip == 1) {
for (int i = 0; i <= buf_size - cksum_size; i++) {
fstats.update(hash(test.step(buf + i), s_bits, s_mask), buf + i);
}
} else {
ptr = buf + last_offset;
end = buf + stop;
for (; ptr != end; ptr -= cksum_skip) {
fstats.update(hash(test.step(ptr), s_bits, s_mask), ptr);
}
}
fstats.freeze();
}
long start_test = get_millisecs_now();
if (cksum_skip != 1) {
new_table(n_steps);
for (int i = 0; i < test_iters; i++) {
ptr = buf + last_offset;
end = buf + stop;
for (; ptr != end; ptr -= cksum_skip) {
set_table_bit(hash(test.step(ptr), s_bits, s_mask));
}
}
summarize_table();
}
stop = buf_size - cksum_size + 1;
if (stop < 0) {
stop = 0;
}
if (cksum_skip == 1) {
new_table(n_incrs);
for (int i = 0; i < test_iters; i++) {
ptr = buf;
end = buf + stop;
if (ptr != end) {
set_table_bit(hash(test.state0(ptr++), s_bits, s_mask));
}
for (; ptr != end; ptr++) {
Word w = test.incr(ptr);
assert(w == test.step(ptr));
set_table_bit(hash(w, s_bits, s_mask));
}
}
summarize_table();
}
accum_iters += test_iters;
accum_millis += get_millisecs_now() - start_test;
}
};
template <typename Word>
void print_array(const char *tname) {
printf("static const %s hash_multiplier[64] = {\n", tname);
Word p = 1;
for (int i = 0; i < 64; i++) {
printf(" %uU,\n", p);
p *= good_word<Word>();
}
printf("};\n", tname);
}
int main(int argc, char** argv) {
int i;
uint8_t *buf = NULL;
size_t buf_len = 0;
int ret;
if (argc <= 1) {
fprintf(stderr, "usage: %s file ...\n", argv[0]);
return 1;
}
//print_array<uint32_t>("uint32_t");
#define TEST(T,Z,S,P,H,C) test_result<T,Z,S,P,H<T>,C> \
_ ## T ## _ ## Z ## _ ## S ## _ ## P ## _ ## H ## _ ## C \
(#T "_" #Z "_" #S "_" #P "_" #H "_" #C)
#if 0
TEST(uint32_t, 4, SKIP, plain, hhash, 0); /* x */ \
TEST(uint32_t, 4, SKIP, plain, hhash, 1); /* x */ \
TEST(uint32_t, 4, SKIP, plain, hhash, 2); /* x */ \
TEST(uint32_t, 4, SKIP, plain, hhash, 3); /* x */ \
#endif
#define TESTS(SKIP) \
TEST(uint32_t, 9, SKIP, plain, hhash, 0); /* x */ \
TEST(uint32_t, 9, SKIP, plain, hhash, 1); /* x */ \
TEST(uint32_t, 9, SKIP, plain, hhash, 2); /* x */ \
TEST(uint32_t, 9, SKIP, plain, hhash, 3)
#define TESTS_ALL(SKIP) \
TEST(uint32_t, 3, SKIP, plain, hhash, 0); \
TEST(uint32_t, 3, SKIP, plain, hhash, 1); \
TEST(uint32_t, 4, SKIP, plain, hhash, 0); /* x */ \
TEST(uint32_t, 4, SKIP, plain, hhash, 1); /* x */ \
TEST(uint32_t, 4, SKIP, plain, hhash, 2); /* x */ \
TEST(uint32_t, 4, SKIP, plain, hhash, 3); /* x */ \
TEST(uint32_t, 5, SKIP, plain, hhash, 0); \
TEST(uint32_t, 5, SKIP, plain, hhash, 1); \
TEST(uint32_t, 8, SKIP, plain, hhash, 0); \
TEST(uint32_t, 8, SKIP, plain, hhash, 1); \
TEST(uint32_t, 9, SKIP, plain, hhash, 0); /* x */ \
TEST(uint32_t, 9, SKIP, plain, hhash, 1); /* x */ \
TEST(uint32_t, 9, SKIP, plain, hhash, 2); /* x */ \
TEST(uint32_t, 9, SKIP, plain, hhash, 3); /* x */ \
TEST(uint32_t, 11, SKIP, plain, hhash, 0); /* x */ \
TEST(uint32_t, 11, SKIP, plain, hhash, 1); /* x */ \
TEST(uint32_t, 13, SKIP, plain, hhash, 0); \
TEST(uint32_t, 13, SKIP, plain, hhash, 1); \
TEST(uint32_t, 15, SKIP, plain, hhash, 0); /* x */ \
TEST(uint32_t, 15, SKIP, plain, hhash, 1); /* x */ \
TEST(uint32_t, 16, SKIP, plain, hhash, 0); /* x */ \
TEST(uint32_t, 16, SKIP, plain, hhash, 1); /* x */ \
TEST(uint32_t, 21, SKIP, plain, hhash, 0); \
TEST(uint32_t, 21, SKIP, plain, hhash, 1); \
TEST(uint32_t, 34, SKIP, plain, hhash, 0); \
TEST(uint32_t, 34, SKIP, plain, hhash, 1); \
TEST(uint32_t, 55, SKIP, plain, hhash, 0); \
TEST(uint32_t, 55, SKIP, plain, hhash, 1)
TESTS(1); // *
// TESTS(2); // *
// TESTS(3); // *
// TESTS(5); // *
// TESTS(8); // *
// TESTS(9);
// TESTS(11);
// TESTS(13); // *
TESTS(15);
// TESTS(16);
// TESTS(21); // *
// TESTS(34); // *
// TESTS(55); // *
// TESTS(89); // *
for (i = 1; i < argc; i++) {
if ((ret = read_whole_file(argv[i],
& buf,
& buf_len))) {
return 1;
}
fprintf(stderr, "file %s is %zu bytes\n",
argv[i], buf_len);
double min_time = -1.0;
double min_compression = 0.0;
for (vector<test_result_base*>::iterator i = all_tests.begin();
i != all_tests.end(); ++i) {
test_result_base *test = *i;
test->reset();
int iters = 100;
long start_test = get_millisecs_now();
do {
test->get(buf, buf_len, iters);
iters *= 3;
iters /= 2;
} while (get_millisecs_now() - start_test < 2000);
test->stat();
if (min_time < 0.0) {
min_compression = test->compression();
min_time = test->time();
}
if (min_time > test->time()) {
min_time = test->time();
}
if (min_compression > test->compression()) {
min_compression = test->compression();
}
test->print();
}
// for (vector<test_result_base*>::iterator i = all_tests.begin();
// i != all_tests.end(); ++i) {
// test_result_base *test = *i;
// test->set_score(min_compression, min_time);
// }
// sort(all_tests.begin(), all_tests.end(), compare_h());
// for (vector<test_result_base*>::iterator i = all_tests.begin();
// i != all_tests.end(); ++i) {
// test_result_base *test = *i;
// test->print();
// }
free(buf);
buf = NULL;
}
return 0;
}
| 21.165075 | 121 | 0.589532 | [
"vector"
] |
028a274666854741db0752d9d9591d71deec10e1 | 41,150 | cpp | C++ | src/real_space_prj.cpp | cocteautwins/SIRIUS-develop | 8ab09ca7cc69e9a7dc76475b7b562b20d56deea3 | [
"BSD-2-Clause"
] | null | null | null | src/real_space_prj.cpp | cocteautwins/SIRIUS-develop | 8ab09ca7cc69e9a7dc76475b7b562b20d56deea3 | [
"BSD-2-Clause"
] | null | null | null | src/real_space_prj.cpp | cocteautwins/SIRIUS-develop | 8ab09ca7cc69e9a7dc76475b7b562b20d56deea3 | [
"BSD-2-Clause"
] | null | null | null | #include <gsl/gsl_sf_bessel.h>
#include "real_space_prj.h"
namespace sirius {
Real_space_prj::Real_space_prj(Unit_cell& unit_cell__,
Communicator const& comm__,
double R_mask_scale__,
double mask_alpha__,
double pw_cutoff__,
int num_fft_threads__,
int num_fft_workers__)
: unit_cell_(unit_cell__),
comm_(comm__),
R_mask_scale_(R_mask_scale__),
mask_alpha_(mask_alpha__)
{
PROFILE("sirius::Real_space_prj::Real_space_prj");
pw_cutoff__ *= mask_alpha__;
std::cout << "pw_cutoff__" << pw_cutoff__ << std::endl;
//== for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
//== {
//== std::stringstream s;
//== s << "beta_rf_" << iat << ".dat";
//== FILE* fout = fopen(s.str().c_str(), "w");
//== for (int idxrf = 0; idxrf < unit_cell_.atom_type(iat)->pp_desc().num_beta_radial_functions; idxrf++)
//== {
//== for (int ir = 0; ir < unit_cell_.atom_type(iat)->pp_desc().num_beta_radial_points[idxrf]; ir++)
//== {
//== fprintf(fout, "%18.12f %18.12f\n", unit_cell_.atom_type(iat)->radial_grid(ir),
//== unit_cell_.atom_type(iat)->pp_desc().beta_radial_functions(ir, idxrf));
//== }
//== fprintf(fout, "\n");
//== }
//== fclose(fout);
//== }
std::vector<double> lww_mask = {
0.10000000E+01, 0.10000000E+01, 0.99948662E+00, 0.99863154E+00,
0.99743557E+00, 0.99589985E+00, 0.99402586E+00, 0.99181538E+00,
0.98927052E+00, 0.98639370E+00, 0.98318766E+00, 0.97965544E+00,
0.97580040E+00, 0.97162618E+00, 0.96713671E+00, 0.96233623E+00,
0.95722924E+00, 0.95182053E+00, 0.94611516E+00, 0.94011842E+00,
0.93383589E+00, 0.92727338E+00, 0.92043693E+00, 0.91333282E+00,
0.90596753E+00, 0.89834777E+00, 0.89048044E+00, 0.88237263E+00,
0.87403161E+00, 0.86546483E+00, 0.85667987E+00, 0.84768450E+00,
0.83848659E+00, 0.82909416E+00, 0.81951535E+00, 0.80975838E+00,
0.79983160E+00, 0.78974340E+00, 0.77950227E+00, 0.76911677E+00,
0.75859548E+00, 0.74794703E+00, 0.73718009E+00, 0.72630334E+00,
0.71532544E+00, 0.70425508E+00, 0.69310092E+00, 0.68187158E+00,
0.67057566E+00, 0.65922170E+00, 0.64781819E+00, 0.63637355E+00,
0.62489612E+00, 0.61339415E+00, 0.60187581E+00, 0.59034914E+00,
0.57882208E+00, 0.56730245E+00, 0.55579794E+00, 0.54431609E+00,
0.53286431E+00, 0.52144984E+00, 0.51007978E+00, 0.49876105E+00,
0.48750040E+00, 0.47630440E+00, 0.46517945E+00, 0.45413176E+00,
0.44316732E+00, 0.43229196E+00, 0.42151128E+00, 0.41083069E+00,
0.40025539E+00, 0.38979038E+00, 0.37944042E+00, 0.36921008E+00,
0.35910371E+00, 0.34912542E+00, 0.33927912E+00, 0.32956851E+00,
0.31999705E+00, 0.31056799E+00, 0.30128436E+00, 0.29214897E+00,
0.28316441E+00, 0.27433307E+00, 0.26565709E+00, 0.25713844E+00,
0.24877886E+00, 0.24057988E+00, 0.23254283E+00, 0.22466884E+00,
0.21695884E+00, 0.20941357E+00, 0.20203357E+00, 0.19481920E+00,
0.18777065E+00, 0.18088790E+00, 0.17417080E+00, 0.16761900E+00,
0.16123200E+00, 0.15500913E+00, 0.14894959E+00, 0.14305240E+00,
0.13731647E+00, 0.13174055E+00, 0.12632327E+00, 0.12106315E+00,
0.11595855E+00, 0.11100775E+00, 0.10620891E+00, 0.10156010E+00,
0.97059268E-01, 0.92704295E-01, 0.88492966E-01, 0.84422989E-01,
0.80492001E-01, 0.76697569E-01, 0.73037197E-01, 0.69508335E-01,
0.66108380E-01, 0.62834685E-01, 0.59684561E-01, 0.56655284E-01,
0.53744102E-01, 0.50948236E-01, 0.48264886E-01, 0.45691239E-01,
0.43224469E-01, 0.40861744E-01, 0.38600231E-01, 0.36437098E-01,
0.34369520E-01, 0.32394681E-01, 0.30509780E-01, 0.28712032E-01,
0.26998673E-01, 0.25366964E-01, 0.23814193E-01, 0.22337676E-01,
0.20934765E-01, 0.19602844E-01, 0.18339338E-01, 0.17141711E-01,
0.16007467E-01, 0.14934157E-01, 0.13919377E-01, 0.12960772E-01,
0.12056034E-01, 0.11202905E-01, 0.10399183E-01, 0.96427132E-02,
0.89313983E-02, 0.82631938E-02, 0.76361106E-02, 0.70482151E-02,
0.64976294E-02, 0.59825322E-02, 0.55011581E-02, 0.50517982E-02,
0.46327998E-02, 0.42425662E-02, 0.38795566E-02, 0.35422853E-02,
0.32293218E-02, 0.29392897E-02, 0.26708663E-02, 0.24227820E-02,
0.21938194E-02, 0.19828122E-02, 0.17886449E-02, 0.16102512E-02,
0.14466132E-02, 0.12967606E-02, 0.11597692E-02, 0.10347601E-02,
0.92089812E-03, 0.81739110E-03, 0.72348823E-03, 0.63847906E-03,
0.56169212E-03, 0.49249371E-03, 0.43028657E-03, 0.37450862E-03,
0.32463165E-03, 0.28016004E-03, 0.24062948E-03, 0.20560566E-03,
0.17468305E-03, 0.14748362E-03, 0.12365560E-03, 0.10287226E-03,
0.84830727E-04, 0.69250769E-04, 0.55873673E-04, 0.44461100E-04,
0.34793983E-04, 0.26671449E-04, 0.19909778E-04, 0.14341381E-04,
0.98138215E-05
};
std::vector<double> x(201);
for (int i = 0; i < 201; i++) x[i] = i * 0.005;
Radial_grid r(x);
mask_spline_ = Spline<double>(r, lww_mask);
mask_spline_.interpolate();
if (mask(1, 1) > 1e-13) TERMINATE("wrong mask function");
fft_ = new FFT3D(Utils::find_translations(pw_cutoff__, unit_cell_.reciprocal_lattice_vectors()),
MPI_COMM_SELF, CPU);
STOP();
//gvec_ = Gvec(vector3d<double>(0, 0, 0), unit_cell_.reciprocal_lattice_vectors(), pw_cutoff__, fft_->grid(), fft_->comm(), 1, false, false);
//double rmin = 15 / fft_->gvec_shell_len(fft_->num_gvec_shells_inner() - 1) / R_mask_scale_;
spl_num_gvec_ = splindex<block>(fft_->size(), comm_.size(), comm_.rank());
get_beta_R();
get_beta_grid();
std::vector<Radial_grid> beta_radial_grid(unit_cell_.num_atom_types());
/* radial beta functions */
mdarray<Spline<double>, 2> beta_rf(unit_cell_.max_mt_radial_basis_size(), unit_cell_.num_atom_types());
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
auto& atom_type = unit_cell_.atom_type(iat);
/* create radial grid for all beta-projectors */
beta_radial_grid[iat] = atom_type.radial_grid().segment(nr_beta_[iat]);
double Rmask = R_beta_[iat] * R_mask_scale_;
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
{
beta_rf(idxrf, iat) = Spline<double>(beta_radial_grid[iat]);
for (int ir = 0; ir < nr_beta_[iat]; ir++)
{
double x = beta_radial_grid[iat][ir];
beta_rf(idxrf, iat)[ir] = atom_type.pp_desc().beta_radial_functions(ir, idxrf) / mask(x, Rmask);
}
beta_rf(idxrf, iat).interpolate();
}
}
auto beta_radial_integrals = generate_beta_radial_integrals(beta_rf, 1);
//filter_radial_functions(mask_alpha_ * pw_cutoff__);
//filter_radial_functions_v2(pw_cutoff__);
//auto beta_radial_integrals_filtered = generate_beta_radial_integrals(beta_rf_filtered_, 2);
//== double err = 0;
//== for (int igsh = 0; igsh < fft_->num_gvec_shells_total(); igsh++)
//== {
//== for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
//== {
//== auto atom_type = unit_cell_.atom_type(iat);
//== for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
//== err += std::abs(beta_radial_integrals(idxrf, iat, igsh) - beta_radial_integrals_filtered(idxrf, iat, igsh));
//== }
//== }
//== printf("Total error in radial integrals: %f\n", err);
auto beta_pw_t = generate_beta_pw_t(beta_radial_integrals);
std::vector<double_complex> beta_pw(fft_->size());
for (int ia = 0; ia < unit_cell_.num_atoms(); ia++)
{
int iat = unit_cell_.atom(ia).type_id();
auto& atom_type = unit_cell_.atom_type(iat);
double Rmask = R_beta_[iat] * R_mask_scale_;
beta_projectors_[ia].beta_ = mdarray<double, 2>(beta_projectors_[ia].num_points_, atom_type.mt_basis_size());
for (int xi = 0; xi < atom_type.mt_basis_size(); xi++)
{
for (int ig_loc = 0; ig_loc < (int)spl_num_gvec_.local_size(); ig_loc++)
{
int ig = (int)spl_num_gvec_[ig_loc];
double_complex phase_factor = std::exp(double_complex(0.0, twopi * (gvec_.gvec(ig) * unit_cell_.atom(ia).position())));
beta_pw[ig] = beta_pw_t(ig_loc, atom_type.offset_lo() + xi) * std::conj(phase_factor);
}
comm_.allgather(&beta_pw[0], (int)spl_num_gvec_.global_offset(), (int)spl_num_gvec_.local_size());
memset(&fft_->buffer(0), 0, fft_->size() * sizeof(double_complex));
for (int ig = 0; ig < fft_->size(); ig++)
{
auto gv = gvec_.gvec(ig);
double_complex z = beta_pw[ig];
//auto gvec_cart = fft_->gvec_cart(ig);
//if (gvec_cart.length() > pw_cutoff__) z *= std::exp(-mask_alpha_ * std::pow(gvec_cart.length() / pw_cutoff__ - 1, 2));
fft_->buffer(fft_->grid().index_by_gvec(gv[0], gv[1], gv[2])) = z;
}
//fft_->input(fft_->num_gvec(), fft_->index_map(), &beta_pw[0]);
STOP();
//fft_->transform(1, );
//== double p = 0;
//== for (int i = 0; i < fft_->size(); i++)
//== p += std::pow(std::abs(fft_->buffer(i)), 2);
//== std::cout << "ia,xi="<<ia<<", "<<xi<<" prod="<<p * unit_cell_.omega() / fft_->size() << std::endl;
for (int i = 0; i < beta_projectors_[ia].num_points_; i++)
{
int ir = beta_projectors_[ia].ir_[i];
double dist = beta_projectors_[ia].dist_[i];
double b = real(fft_->buffer(ir) * mask(dist, Rmask));
beta_projectors_[ia].beta_(i, xi) = b;
}
//int lm = atom_type.indexb(xi).lm;
//int idxrf = atom_type.indexb(xi).idxrf;
//int lmax = unit_cell_.lmax_beta();
//double rlm[Utils::lmmax(lmax)];
//for (int i = 0; i < beta_projectors_[ia].num_points_; i++)
//{
// auto rtp = beta_projectors_[ia].rtp_[i];
// SHT::spherical_harmonics(lmax, rtp[1], rtp[2], &rlm[0]);
// beta_projectors_[ia].beta_(i, xi) = beta_rf_filtered_(idxrf, iat)(rtp[0]) * rlm[lm];
//}
}
}
if (false)
{
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
auto& atom_type = unit_cell_.atom_type(iat);
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
{
for (int ir = 0; ir < nr_beta_[iat]; ir++)
beta_rf(idxrf, iat)[ir] = atom_type.pp_desc().beta_radial_functions(ir, idxrf);
beta_rf(idxrf, iat).interpolate();
}
}
beta_radial_integrals = generate_beta_radial_integrals(beta_rf, 1);
beta_pw_t = generate_beta_pw_t(beta_radial_integrals);
for (int ia = 0; ia < unit_cell_.num_atoms(); ia++)
{
int iat = unit_cell_.atom(ia).type_id();
auto& atom_type = unit_cell_.atom_type(iat);
double err = 0;
for (int xi = 0; xi < atom_type.mt_basis_size(); xi++)
{
for (int ig_loc = 0; ig_loc < spl_num_gvec_.local_size(); ig_loc++)
{
int ig = spl_num_gvec_[ig_loc];
double_complex phase_factor = std::exp(double_complex(0.0, twopi * (gvec_.gvec(ig) * unit_cell_.atom(ia).position())));
beta_pw[ig] = beta_pw_t(ig_loc, atom_type.offset_lo() + xi) * std::conj(phase_factor);
}
comm_.allgather(&beta_pw[0], (int)spl_num_gvec_.global_offset(), (int)spl_num_gvec_.local_size());
for (int ig = 0; ig < gvec_.num_gvec(); ig++)
{
double_complex z(0, 0);
for (int i = 0; i < beta_projectors_[ia].num_points_; i++)
{
double phase = twopi * (beta_projectors_[ia].r_[i] * gvec_.gvec(ig));
z += std::exp(double_complex(0, -phase)) * beta_projectors_[ia].beta_(i, xi);
}
err += std::abs(beta_pw[ig] - z / std::sqrt(unit_cell_.omega()));
}
}
std::cout << "err=" << err << std::endl;
STOP();
//for (int xi1 = 0; xi1 < atom_type.mt_basis_size(); xi1++)
//{
// int lm1 = atom_type.indexb(xi1).lm;
// int idxrf1 = atom_type.indexb(xi1).idxrf;
// for (int xi2 = 0; xi2 < atom_type.mt_basis_size(); xi2++)
// {
// int lm2 = atom_type.indexb(xi2).lm;
// int idxrf2 = atom_type.indexb(xi2).idxrf;
// double prod_rs = 0;
// for (int i = 0; i < beta_projectors_[ia].num_points_; i++)
// {
// prod_rs += beta_projectors_[ia].beta_(i, xi1) * beta_projectors_[ia].beta_(i, xi2);
// }
// prod_rs *= (unit_cell_.omega() / fft_->size());
//
// double prod_pw = 0;
// for (int ig = 0; ig < fft_->num_gvec(); ig++)
// {
// prod_pw += real(conj(beta_pw_t(ig, atom_type.offset_lo() + xi1)) * beta_pw_t(ig, atom_type.offset_lo() + xi2));
// }
// prod_pw *= unit_cell_.omega();
// double prod_exact = 0;
// if (lm1 == lm2)
// {
// for (int ir = 0; ir < nr_beta_[iat]; ir++)
// {
// s[ir] = atom_type.pp_desc().beta_radial_functions(ir, idxrf1) * atom_type.pp_desc().beta_radial_functions(ir, idxrf2);
// }
// prod_exact = s.interpolate().integrate(0);
// }
// err += std::abs(prod_rs - prod_pw);
// printf("xi1,xi2=%2i,%2i, prod(rs, pw, exact): %18.12f %18.12f %18.12f\n", xi1, xi2, prod_rs, prod_pw, prod_exact);
// }
//}
//if (comm_.rank() == 0)
//{
// printf("atom: %i, projector errror: %12.6f\n", ia, err);
//}
}
}
}
mdarray<double, 3> Real_space_prj::generate_beta_radial_integrals(mdarray<Spline<double>, 2>& beta_rf__, int m__)
{
PROFILE("sirius::Real_space_prj::generate_beta_radial_integrals");
mdarray<double, 3> beta_radial_integrals(unit_cell_.max_mt_radial_basis_size(),
unit_cell_.num_atom_types(),
gvec_.num_shells());
splindex<block> spl_gsh(gvec_.num_shells(), comm_.size(), comm_.rank());
#pragma omp parallel
{
mdarray<Spline<double>, 2> jl(unit_cell_.lmax() + 1, unit_cell_.num_atom_types());
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iat) = Spline<double>(beta_rf__(0, iat).radial_grid());
}
#pragma omp for
for (int igsh_loc = 0; igsh_loc < (int)spl_gsh.local_size(); igsh_loc++)
{
int igsh = (int)spl_gsh[igsh_loc];
/* get spherical Bessel functions */
double G = gvec_.shell_len(igsh);
std::vector<double> v(unit_cell_.lmax() + 1);
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
for (int ir = 0; ir < beta_rf__(0, iat).num_points(); ir++)
{
double x = beta_rf__(0, iat).x(ir) * G;
gsl_sf_bessel_jl_array(unit_cell_.lmax(), x, &v[0]);
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iat)[ir] = v[l];
}
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iat).interpolate();
}
/* compute radial integrals */
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
auto& atom_type = unit_cell_.atom_type(iat);
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
{
int l = atom_type.indexr(idxrf).l;
int nr = beta_rf__(idxrf, iat).num_points();
beta_radial_integrals(idxrf, iat, igsh) = inner(jl(l, iat), beta_rf__(idxrf, iat), m__, nr);
}
}
}
}
int ld = unit_cell_.max_mt_radial_basis_size() * unit_cell_.num_atom_types();
comm_.allgather(beta_radial_integrals.at<CPU>(), static_cast<int>(ld * spl_gsh.global_offset()),
static_cast<int>(ld * spl_gsh.local_size()));
return beta_radial_integrals;
}
mdarray<double_complex, 2> Real_space_prj::generate_beta_pw_t(mdarray<double, 3>& beta_radial_integrals__)
{
PROFILE("sirius::Real_space_prj::generate_beta_pw_t");
STOP();
mdarray<double_complex, 2> beta_pw_t;//(spl_num_gvec_.local_size(), unit_cell_.num_beta_t());
//#pragma omp parallel
//{
// std::vector<double> gvec_rlm(Utils::lmmax(unit_cell_.lmax_beta()));
// #pragma omp for
// for (int ig_loc = 0; ig_loc < (int)spl_num_gvec_.local_size(); ig_loc++)
// {
// int ig = (int)spl_num_gvec_[ig_loc];
// auto rtp = SHT::spherical_coordinates(gvec_.cart(ig));
// SHT::spherical_harmonics(unit_cell_.lmax_beta(), rtp[1], rtp[2], &gvec_rlm[0]);
// int igsh = gvec_.shell(ig);
// for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
// {
// auto atom_type = unit_cell_.atom_type(iat);
//
// for (int xi = 0; xi < atom_type.mt_basis_size(); xi++)
// {
// int l = atom_type.indexb(xi).l;
// int lm = atom_type.indexb(xi).lm;
// int idxrf = atom_type.indexb(xi).idxrf;
// double_complex z = std::pow(double_complex(0, -1), l) * fourpi / unit_cell_.omega();
// beta_pw_t(ig_loc, atom_type.offset_lo() + xi) = z * gvec_rlm[lm] * beta_radial_integrals__(idxrf, iat, igsh);
// }
// }
// }
//}
return beta_pw_t;
}
void Real_space_prj::filter_radial_functions(double pw_cutoff__)
{
int nq = 200;
//double alpha = mask_alpha_;
//double qcut = pw_cutoff__ / alpha;
//double b = 5.0 * std::log(10.0) / std::pow(alpha - 1, 2);
mdarray<double, 3> beta_radial_integrals(unit_cell_.max_mt_radial_basis_size(), unit_cell_.num_atom_types(), nq);
/* interpolate beta radial functions divided by a mask function */
std::vector<Radial_grid> beta_radial_grid(unit_cell_.num_atom_types());
mdarray<Spline<double>, 2> beta_rf(unit_cell_.max_mt_radial_basis_size(), unit_cell_.num_atom_types());
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
auto& atom_type = unit_cell_.atom_type(iat);
/* create radial grid for all beta-projectors */
beta_radial_grid[iat] = atom_type.radial_grid().segment(nr_beta_[iat]);
double Rmask = R_beta_[iat] * R_mask_scale_;
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
{
beta_rf(idxrf, iat) = Spline<double>(beta_radial_grid[iat]);
for (int ir = 0; ir < nr_beta_[iat]; ir++)
{
double x = beta_radial_grid[iat][ir];
beta_rf(idxrf, iat)[ir] = atom_type.pp_desc().beta_radial_functions(ir, idxrf) / mask(x, Rmask);
}
beta_rf(idxrf, iat).interpolate();
}
}
splindex<block> spl_nq(nq, comm_.size(), comm_.rank());
#pragma omp parallel
{
mdarray<Spline<double>, 2> jl(unit_cell_.lmax() + 1, unit_cell_.num_atom_types());
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iat) = Spline<double>(beta_radial_grid[iat]);
}
#pragma omp for
for (int iq_loc = 0; iq_loc < (int)spl_nq.local_size(); iq_loc++)
{
int iq = (int)spl_nq[iq_loc];
double q = pw_cutoff__ * iq / (nq - 1);
/* get spherical Bessel functions */
std::vector<double> v(unit_cell_.lmax() + 1);
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
for (int ir = 0; ir < nr_beta_[iat]; ir++)
{
double qx = beta_radial_grid[iat][ir] * q;
gsl_sf_bessel_jl_array(unit_cell_.lmax(), qx, &v[0]);
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iat)[ir] = v[l];
}
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iat).interpolate();
}
/* compute radial integrals */
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
auto& atom_type = unit_cell_.atom_type(iat);
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
{
int l = atom_type.indexr(idxrf).l;
int nr = nr_beta_[iat];
beta_radial_integrals(idxrf, iat, iq) = inner(jl(l, iat), beta_rf(idxrf, iat), 1, nr);
}
}
}
}
int ld = unit_cell_.max_mt_radial_basis_size() * unit_cell_.num_atom_types();
comm_.allgather(beta_radial_integrals.at<CPU>(), static_cast<int>(ld * spl_nq.global_offset()),
static_cast<int>(ld * spl_nq.local_size()));
int N = 3000;
beta_rf_filtered_ = mdarray<Spline<double>, 2>(unit_cell_.max_mt_radial_basis_size(), unit_cell_.num_atom_types());
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
auto& atom_type = unit_cell_.atom_type(iat);
double Rmask = R_beta_[iat] * R_mask_scale_;
beta_radial_grid[iat] = Radial_grid(pow2_grid, N, 0, Rmask);
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
{
beta_rf_filtered_(idxrf, iat) = Spline<double>(beta_radial_grid[iat]);
}
}
mdarray<Spline<double>, 2> jl(unit_cell_.lmax() + 1, unit_cell_.num_atom_types());
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iat) = Spline<double>(beta_radial_grid[iat]);
}
for (int iq_loc = 0; iq_loc < (int)spl_nq.local_size(); iq_loc++)
{
int iq = (int)spl_nq[iq_loc];
double q = pw_cutoff__ * iq / (nq - 1);
double w = 1; //(q < qcut) ? 1 : std::exp(-b * std::pow(q / qcut - 1, 2));
/* get spherical Bessel functions */
std::vector<double> v(unit_cell_.lmax() + 1);
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
for (int ir = 0; ir < N; ir++)
{
double qx = beta_radial_grid[iat][ir] * q;
gsl_sf_bessel_jl_array(unit_cell_.lmax(), qx, &v[0]);
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iat)[ir] = v[l];
}
}
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
//double Rmask = R_beta_[iat] * R_mask_scale_;
auto& atom_type = unit_cell_.atom_type(iat);
#pragma omp parallel for
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
{
int l = atom_type.indexr(idxrf).l;
double p = (2.0 / pi) * q * q * beta_radial_integrals(idxrf, iat, iq) * pw_cutoff__ / (nq - 1) * w;
for (int ir = 0; ir < N; ir++)
{
//double x = beta_radial_grid[iat][ir];
beta_rf_filtered_(idxrf, iat)[ir] += p * jl(l, iat)[ir];// * mask(x, Rmask);
}
}
}
}
FILE* fout = fopen("beta_q.dat", "w");
for (int iq = 0; iq < nq; iq++)
{
//double q = pw_cutoff__ * iq / (nq - 1);
double w = 1; //(q < qcut) ? 1 : std::exp(-b * std::pow(q / qcut - 1, 2));
fprintf(fout, "%i %18.12f\n", iq, beta_radial_integrals(0, 0, iq) * w);
}
fclose(fout);
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
auto& atom_type = unit_cell_.atom_type(iat);
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
beta_rf_filtered_(idxrf, iat).interpolate();
}
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
std::stringstream s;
s << "beta_rf_" << iat << ".dat";
FILE* fout = fopen(s.str().c_str(), "w");
for (int idxrf = 0; idxrf < unit_cell_.atom_type(iat).pp_desc().num_beta_radial_functions; idxrf++)
{
for (int ir = 0; ir < N; ir++)
{
fprintf(fout, "%18.12f %18.12f\n", beta_radial_grid[iat][ir], beta_rf_filtered_(idxrf, iat)[ir]);
}
fprintf(fout, "\n");
}
fclose(fout);
}
//STOP();
}
void Real_space_prj::filter_radial_functions_v2(double pw_cutoff__)
{
int nq0 = 40;
double dq = pw_cutoff__ / (nq0 - 1);
int nqmax = 4 * nq0;
//double qmax = dq * (nqmax - 1);
int nq1 = nqmax - nq0;
mdarray<double, 3> beta_radial_integrals(unit_cell_.max_mt_radial_basis_size(), unit_cell_.num_atom_types(), nq0);
mdarray<double, 3> beta_radial_integrals_optimized(unit_cell_.max_mt_radial_basis_size(), unit_cell_.num_atom_types(), nqmax);
std::vector<Radial_grid> beta_radial_grid(unit_cell_.num_atom_types());
/* interpolate beta radial functions */
mdarray<Spline<double>, 2> beta_rf(unit_cell_.max_mt_radial_basis_size(), unit_cell_.num_atom_types());
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
auto& atom_type = unit_cell_.atom_type(iat);
/* create radial grid for all beta-projectors */
beta_radial_grid[iat] = atom_type.radial_grid().segment(nr_beta_[iat]);
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
{
beta_rf(idxrf, iat) = Spline<double>(beta_radial_grid[iat]);
for (int ir = 0; ir < nr_beta_[iat]; ir++)
{
beta_rf(idxrf, iat)[ir] = atom_type.pp_desc().beta_radial_functions(ir, idxrf);
}
beta_rf(idxrf, iat).interpolate();
}
}
splindex<block> spl_nq(nq0, comm_.size(), comm_.rank());
#pragma omp parallel
{
mdarray<Spline<double>, 2> jl(unit_cell_.lmax() + 1, unit_cell_.num_atom_types());
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iat) = Spline<double>(beta_rf(0, iat).radial_grid());
}
#pragma omp for
for (int iq_loc = 0; iq_loc < (int)spl_nq.local_size(); iq_loc++)
{
int iq = (int)spl_nq[iq_loc];
double q = iq * dq;
/* get spherical Bessel functions */
std::vector<double> v(unit_cell_.lmax() + 1);
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
for (int ir = 0; ir < nr_beta_[iat]; ir++)
{
double qx = beta_rf(0, iat).x(ir) * q;
gsl_sf_bessel_jl_array(unit_cell_.lmax(), qx, &v[0]);
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iat)[ir] = v[l];
}
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iat).interpolate();
}
/* compute radial integrals */
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
auto& atom_type = unit_cell_.atom_type(iat);
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
{
int l = atom_type.indexr(idxrf).l;
int nr = nr_beta_[iat];
beta_radial_integrals(idxrf, iat, iq) = inner(jl(l, iat), beta_rf(idxrf, iat), 1, nr);
}
}
}
}
int ld = unit_cell_.max_mt_radial_basis_size() * unit_cell_.num_atom_types();
comm_.allgather(beta_radial_integrals.at<CPU>(), static_cast<int>(ld * spl_nq.global_offset()),
static_cast<int>(ld * spl_nq.local_size()));
int N = 3000;
mdarray<Spline<double>, 2> jl(unit_cell_.lmax() + 1, nqmax);
auto jl_radial_grid = Radial_grid(linear_grid, N, 0, 100);
std::vector<double> v(unit_cell_.lmax() + 1);
for (int iq = 0; iq < nqmax; iq++)
{
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iq) = Spline<double>(jl_radial_grid);
for (int ir = 0; ir < N; ir++)
{
double qx = jl_radial_grid[ir] * iq * dq;
gsl_sf_bessel_jl_array(unit_cell_.lmax(), qx, &v[0]);
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iq)[ir] = v[l];
}
for (int l = 0; l <= unit_cell_.lmax(); l++) jl(l, iq).interpolate();
}
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
auto& atom_type = unit_cell_.atom_type(iat);
double Rmask = R_beta_[iat] * R_mask_scale_;
int nr = -1;
for (int ir = 0; ir < N; ir++)
{
if (jl_radial_grid[ir] >= Rmask)
{
nr = ir;
break;
}
}
mdarray<double, 3> M01(nq0, nq1, unit_cell_.lmax() + 1);
mdarray<double, 3> M11(nq1, nq1, unit_cell_.lmax() + 1);
for (int l = 0; l <= unit_cell_.lmax(); l++)
{
for (int jq = 0; jq < nq1; jq++)
{
for (int iq = 0; iq < nq0; iq++)
{
M01(iq, jq, l) = (inner(jl(l, iq), jl(l, nq0 + jq), 0) -
inner(jl(l, iq), jl(l, nq0 + jq), 0, nr)) *
std::pow(dq * iq, 2) * std::pow(dq * (jq + nq0), 2) * dq * dq * std::pow(2.0 / pi, 2);
}
for (int iq = 0; iq < nq1; iq++)
{
M11(iq, jq, l) = (inner(jl(l, nq0 + iq), jl(l, nq0 + jq), 0) -
inner(jl(l, nq0 + iq), jl(l, nq0 + jq), 0, nr)) *
std::pow(dq * (iq + nq0), 2) * std::pow(dq * (jq + nq0), 2) * dq * dq * std::pow(2.0 / pi, 2);
std::cout << "M11=" << M11(iq,jq,l) << std::endl;
}
}
matrix<double> tmp(&M11(0, 0, l), nq1, nq1);
linalg<CPU>::syinv(nq1, tmp);
/* restore lower triangular part */
for (int j1 = 0; j1 < nq1; j1++)
{
for (int j2 = 0; j2 < j1; j2++)
{
M11(j1, j2, l) = M11(j2, j1);
std::cout << "M11_inv=" << M11(j1,j2,l) << std::endl;
}
}
}
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
{
int l = atom_type.indexr(idxrf).l;
std::vector<double> v1(nq1, 0);
std::vector<double> f1(nq1, 0);
for (int iq = 0; iq < nq1; iq++)
{
for (int jq = 0; jq < nq0; jq++) v1[iq] += M01(jq, iq, l) * beta_radial_integrals(idxrf, iat, jq);
std::cout << "v1[jq]="<<v1[iq] << std::endl;
}
for (int iq = 0; iq < nq1; iq++)
{
for (int jq = 0; jq < nq1; jq++) f1[iq] += M11(iq, jq, l) * v1[jq];
}
for (int iq = 0; iq < nq0; iq++) beta_radial_integrals_optimized(idxrf, iat, iq) = beta_radial_integrals(idxrf, iat, iq);
for (int iq = 0; iq < nq1; iq++) beta_radial_integrals_optimized(idxrf, iat, nq0 + iq) = -f1[iq];
}
}
beta_rf_filtered_ = mdarray<Spline<double>, 2>(unit_cell_.max_mt_radial_basis_size(), unit_cell_.num_atom_types());
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
auto& atom_type = unit_cell_.atom_type(iat);
double Rmask = R_beta_[iat] * R_mask_scale_;
auto beta_radial_grid = Radial_grid(pow2_grid, N, 0, Rmask);
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
{
beta_rf_filtered_(idxrf, iat) = Spline<double>(beta_radial_grid);
}
}
mdarray<Spline<double>, 2> sf_bessel_jl(unit_cell_.lmax() + 1, unit_cell_.num_atom_types());
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
for (int l = 0; l <= unit_cell_.lmax(); l++) sf_bessel_jl(l, iat) = Spline<double>(beta_rf_filtered_(0, iat).radial_grid());
}
spl_nq = splindex<block>(nqmax, comm_.size(), comm_.rank());
for (int iq_loc = 0; iq_loc < (int)spl_nq.local_size(); iq_loc++)
{
int iq = (int)spl_nq[iq_loc];
double q = iq * dq;
/* get spherical Bessel functions */
std::vector<double> v(unit_cell_.lmax() + 1);
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
for (int ir = 0; ir < N; ir++)
{
double qx = beta_rf_filtered_(0, iat).x(ir) * q;
gsl_sf_bessel_jl_array(unit_cell_.lmax(), qx, &v[0]);
for (int l = 0; l <= unit_cell_.lmax(); l++) sf_bessel_jl(l, iat)[ir] = v[l];
}
}
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
auto& atom_type = unit_cell_.atom_type(iat);
#pragma omp parallel for
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
{
int l = atom_type.indexr(idxrf).l;
double p = (2.0 / pi) * q * q * beta_radial_integrals_optimized(idxrf, iat, iq) * dq;
for (int ir = 0; ir < N; ir++)
{
beta_rf_filtered_(idxrf, iat)[ir] += p * sf_bessel_jl(l, iat)[ir];
}
}
}
}
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
std::stringstream s;
s << "beta_q_" << iat << ".dat";
FILE* fout = fopen(s.str().c_str(), "w");
for (int idxrf = 0; idxrf < unit_cell_.atom_type(iat).pp_desc().num_beta_radial_functions; idxrf++)
{
for (int iq = 0; iq < nqmax; iq++)
{
fprintf(fout, "%i %18.12f\n", iq, beta_radial_integrals_optimized(idxrf, iat, iq));
}
fprintf(fout, "\n");
}
fclose(fout);
}
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
auto& atom_type = unit_cell_.atom_type(iat);
for (int idxrf = 0; idxrf < atom_type.mt_radial_basis_size(); idxrf++)
beta_rf_filtered_(idxrf, iat).interpolate();
}
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
std::stringstream s;
s << "beta_rf_" << iat << ".dat";
FILE* fout = fopen(s.str().c_str(), "w");
for (int idxrf = 0; idxrf < unit_cell_.atom_type(iat).pp_desc().num_beta_radial_functions; idxrf++)
{
for (int ir = 0; ir < N; ir++)
{
fprintf(fout, "%18.12f %18.12f\n", beta_rf_filtered_(idxrf, iat).x(ir), beta_rf_filtered_(idxrf, iat)[ir]);
}
fprintf(fout, "\n");
}
fclose(fout);
}
}
void Real_space_prj::get_beta_R()
{
R_beta_ = std::vector<double>(unit_cell_.num_atom_types(), 0.0);
nr_beta_ = std::vector<int>(unit_cell_.num_atom_types(), 0);
/* get the list of max beta radii */
for (int iat = 0; iat < unit_cell_.num_atom_types(); iat++)
{
for (int idxrf = 0; idxrf < unit_cell_.atom_type(iat).pp_desc().num_beta_radial_functions; idxrf++)
{
int nr = 0;
for (int ir = unit_cell_.atom_type(iat).pp_desc().num_beta_radial_points[idxrf] - 1; ir >= 0; ir--)
{
if (std::abs(unit_cell_.atom_type(iat).pp_desc().beta_radial_functions(ir, idxrf)) > 1e-10)
{
nr = ir + 1;
break;
}
}
R_beta_[iat] = std::max(R_beta_[iat], unit_cell_.atom_type(iat).radial_grid(nr - 1));
//R_beta_[iat] = std::max(R_beta_[iat], rmin);
nr_beta_[iat] = std::max(nr_beta_[iat], nr);
if (comm_.rank() == 0)
{
std::cout << "iat, idxrf = " << iat << ", " << idxrf
<< " R_beta, N_beta = " << R_beta_[iat] << ", " << nr_beta_[iat] << std::endl;
}
}
}
}
void Real_space_prj::get_beta_grid()
{
beta_projectors_ = std::vector<beta_real_space_prj_descriptor>(unit_cell_.num_atoms());
max_num_points_ = 0;
num_points_ = 0;
for (int ia = 0; ia < unit_cell_.num_atoms(); ia++)
{
int iat = unit_cell_.atom(ia).type_id();
double Rmask = R_beta_[iat] * R_mask_scale_;
auto v0 = unit_cell_.lattice_vector(0);
auto v1 = unit_cell_.lattice_vector(1);
auto v2 = unit_cell_.lattice_vector(2);
if (2 * Rmask > v0.length() || 2 * Rmask > v1.length() || 2 * Rmask > v2.length())
{
TERMINATE("unit cell is too smal for real-space projection (beta-sphere overlaps with itself)");
}
beta_projectors_[ia].offset_ = num_points_;
/* loop over 3D array (real space) */
for (int j0 = 0; j0 < fft_->grid().size(0); j0++)
{
for (int j1 = 0; j1 < fft_->grid().size(1); j1++)
{
for (int j2 = 0; j2 < fft_->grid().size(2); j2++)
{
/* get real space fractional coordinate */
vector3d<double> v0(double(j0) / fft_->grid().size(0), double(j1) / fft_->grid().size(1), double(j2) / fft_->grid().size(2));
/* index of real space point */
int ir = fft_->grid().index_by_coord(j0, j1, j2);
bool found = false;
for (int t0 = -1; t0 <= 1; t0++)
{
for (int t1 = -1; t1 <= 1; t1++)
{
for (int t2 = -1; t2 <= 1; t2++)
{
vector3d<double> v1 = v0 - (unit_cell_.atom(ia).position() + vector3d<double>(t0, t1, t2));
auto r = unit_cell_.get_cartesian_coordinates(v1);
if (r.length() <= Rmask)
{
if (found) TERMINATE("point was already found");
beta_projectors_[ia].num_points_++;
beta_projectors_[ia].ir_.push_back(ir);
beta_projectors_[ia].r_.push_back(v0);
beta_projectors_[ia].T_.push_back(vector3d<int>(t0, t1, t2));
beta_projectors_[ia].dist_.push_back(r.length());
beta_projectors_[ia].rtp_.push_back(SHT::spherical_coordinates(r));
found = true;
}
}
}
}
}
}
}
num_points_ += beta_projectors_[ia].num_points_;
max_num_points_ = std::max(max_num_points_, beta_projectors_[ia].num_points_);
}
if (comm_.rank() == 0)
{
for (int ia = 0; ia < unit_cell_.num_atoms(); ia++)
{
int iat = unit_cell_.atom(ia).type_id();
printf("atom: %3i, R_beta: %8.4f, num_points: %5i, estimated num_points: %5i\n", ia, R_beta_[iat],
beta_projectors_[ia].num_points_,
static_cast<int>(fft_->size() * fourpi * std::pow(R_mask_scale_ * R_beta_[iat], 3) / 3.0 / unit_cell_.omega()));
}
printf("sum(num_points): %i\n", num_points_);
}
}
};
| 41.523713 | 148 | 0.52175 | [
"vector",
"transform",
"3d"
] |
0296182a8beaeb084439880a8a18c3dabb0405b7 | 17,403 | hpp | C++ | saga/impl/packages/namespace/namespace_dir_cpi.hpp | saga-project/saga-cpp | 7376c0de0529e7d7b80cf08b94ec484c2e56d38e | [
"BSL-1.0"
] | 5 | 2015-09-15T16:24:14.000Z | 2021-08-12T11:05:55.000Z | saga/impl/packages/namespace/namespace_dir_cpi.hpp | saga-project/saga-cpp | 7376c0de0529e7d7b80cf08b94ec484c2e56d38e | [
"BSL-1.0"
] | null | null | null | saga/impl/packages/namespace/namespace_dir_cpi.hpp | saga-project/saga-cpp | 7376c0de0529e7d7b80cf08b94ec484c2e56d38e | [
"BSL-1.0"
] | 3 | 2016-11-17T04:38:38.000Z | 2021-04-10T17:23:52.000Z | #ifndef SAGA_IMPL_PACKAGES_DATA_NAMESPACE_NAMESPACEDIR_CPI_HPP
#define SAGA_IMPL_PACKAGES_DATA_NAMESPACE_NAMESPACEDIR_CPI_HPP
#if defined(__WAVE__) && defined(SAGA_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/namespace_dir_cpi.hpp")
#endif
// Copyright (c) 2005-2007 Andre Merzky (andre@merzky.net)
// Copyright (c) 2005-2009 Hartmut Kaiser
// Copyright (c) 2005 Michel Zandstra [michelzandstra@gmail.com]
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#if defined(__WAVE__) && defined(SAGA_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#include <string>
#include <saga/saga/util.hpp>
#include <saga/saga/types.hpp>
#include <saga/saga/exception.hpp>
#include <saga/saga/namespace.hpp>
#include <saga/saga/adaptors/instance_data.hpp>
#include <saga/saga/adaptors/packages/namespace_dir_cpi_instance_data.hpp>
#include <saga/impl/call.hpp>
#include <saga/impl/config.hpp>
#include <saga/impl/engine/cpi.hpp>
#include <saga/impl/engine/register_members.hpp>
#include <saga/impl/packages/namespace/namespace_entry_cpi.hpp>
#ifdef SAGA_DEBUG
#include <saga/impl/packages/namespace/preprocessed/namespace_dir_cpi.hpp>
#else
#if defined(__WAVE__) && defined(SAGA_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: "preprocessed/namespace_dir_cpi.hpp")
#endif
///////////////////////////////////////////////////////////////////////////////
namespace saga { namespace impl { namespace v1_0 {
///////////////////////////////////////////////////////////////////////////
class namespace_dir_cpi
: public namespace_entry_cpi
{
public:
namespace_dir_cpi (proxy * p, cpi_info const& info,
TR1::shared_ptr<saga::adaptor> adaptor, cpi::flags flags)
: namespace_entry_cpi (p, info, adaptor, flags)
{
}
~namespace_dir_cpi (void)
{
}
cpi::type get_type() const { return cpi::NSDirectory; }
// navigation/query methods
SAGA_CALL_CPI_DECL_VIRT_1 (namespace_dir_cpi, saga::impl::void_t, change_dir, saga::url)
SAGA_CALL_CPI_DECL_VIRT_2 (namespace_dir_cpi, std::vector <saga::url>, list, std::string, int)
SAGA_CALL_CPI_DECL_VIRT_2 (namespace_dir_cpi, std::vector <saga::url>, find, std::string, int)
SAGA_CALL_CPI_DECL_VIRT_1 (namespace_dir_cpi, saga::url, read_link, saga::url)
SAGA_CALL_CPI_DECL_VIRT_1 (namespace_dir_cpi, bool, exists, saga::url)
SAGA_CALL_CPI_DECL_VIRT_1 (namespace_dir_cpi, bool, is_dir, saga::url)
SAGA_CALL_CPI_DECL_VIRT_1 (namespace_dir_cpi, bool, is_entry, saga::url)
SAGA_CALL_CPI_DECL_VIRT_1 (namespace_dir_cpi, bool, is_link, saga::url)
// Deal with entries by entry number_cpi
SAGA_CALL_CPI_DECL_VIRT_0 (namespace_dir_cpi, std::size_t, get_num_entries)
SAGA_CALL_CPI_DECL_VIRT_1 (namespace_dir_cpi, saga::url, get_entry, std::size_t)
// entry management methods
SAGA_CALL_CPI_DECL_VIRT_3 (namespace_dir_cpi, saga::impl::void_t, copy, saga::url, saga::url, int)
SAGA_CALL_CPI_DECL_VIRT_3 (namespace_dir_cpi, saga::impl::void_t, link, saga::url, saga::url, int)
SAGA_CALL_CPI_DECL_VIRT_3 (namespace_dir_cpi, saga::impl::void_t, move, saga::url, saga::url, int)
SAGA_CALL_CPI_DECL_VIRT_2 (namespace_dir_cpi, saga::impl::void_t, remove, saga::url, int)
SAGA_CALL_CPI_DECL_VIRT_2 (namespace_dir_cpi, saga::impl::void_t, make_dir, saga::url, int)
// open methods
SAGA_CALL_CPI_DECL_VIRT_2 (namespace_dir_cpi, saga::name_space::entry, open, saga::url, int)
SAGA_CALL_CPI_DECL_VIRT_2 (namespace_dir_cpi, saga::name_space::directory, open_dir, saga::url, int)
// entry management methods - wild card versions
SAGA_CALL_CPI_DECL_VIRT_3 (namespace_dir_cpi, saga::impl::void_t, copy_wildcard, std::string, saga::url, int)
SAGA_CALL_CPI_DECL_VIRT_3 (namespace_dir_cpi, saga::impl::void_t, link_wildcard, std::string, saga::url, int)
SAGA_CALL_CPI_DECL_VIRT_3 (namespace_dir_cpi, saga::impl::void_t, move_wildcard, std::string, saga::url, int)
SAGA_CALL_CPI_DECL_VIRT_2 (namespace_dir_cpi, saga::impl::void_t, remove_wildcard, std::string, int)
// permissions with flags
SAGA_CALL_CPI_DECL_VIRT_4(namespace_dir_cpi, saga::impl::void_t, permissions_allow, saga::url, std::string, int, int)
SAGA_CALL_CPI_DECL_VIRT_4(namespace_dir_cpi, saga::impl::void_t, permissions_deny, saga::url, std::string, int, int)
SAGA_CALL_CPI_DECL_VIRT_4(namespace_dir_cpi, saga::impl::void_t, permissions_allow_wildcard, std::string, std::string, int, int)
SAGA_CALL_CPI_DECL_VIRT_4(namespace_dir_cpi, saga::impl::void_t, permissions_deny_wildcard, std::string, std::string, int, int)
}; // class namespace_dir_cpi
///////////////////////////////////////////////////////////////////////////////
}}} // namespace saga::impl::v1_0
///////////////////////////////////////////////////////////////////////////////
namespace saga { namespace adaptors { namespace v1_0 {
///////////////////////////////////////////////////////////////////////////////
// register namespace_dir CPI functions
template <typename Derived>
inline bool
register_namespace_dir_functions(
std::vector<saga::impl::v1_0::cpi_info>& infos,
saga::impl::v1_0::cpi::maker_type maker,
saga::impl::v1_0::preference_type const& prefs,
saga::uuid const& cpi_uuid, saga::uuid const& adaptor_uuid,
std::string const& cpi_name)
{
bool retval = false;
saga::impl::v1_0::cpi_info info(adaptors::namespace_dir_cpi,
cpi_name, maker, prefs, cpi_uuid, adaptor_uuid);
SAGA_LOG(SAGA_VERBOSE_LEVEL_BLURB)
<< "begin register_namespace_dir_functions (" << cpi_name << "): "
<< adaptor_uuid.string() << ":";
typedef saga::impl::v1_0::namespace_dir_cpi base_cpi;
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, change_dir, prefs);
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, list, prefs);
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, exists, prefs);
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, get_num_entries, prefs);
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, get_entry, prefs);
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, make_dir, prefs);
// register ambiguous cpi functions
typedef void (base_cpi::*base_sync_read_link_type)(saga::url&, saga::url);
typedef saga::task (base_cpi::*base_async_read_link_type)(saga::url);
typedef void (Derived::*sync_read_link_type)(saga::url&, saga::url);
typedef saga::task (Derived::*async_read_link_type)(saga::url);
SAGA_REGISTER_MEMBER_EX(retval, info, base_cpi, Derived, read_link, prefs,
base_sync_read_link_type, base_async_read_link_type,
sync_read_link_type, async_read_link_type);
typedef void (base_cpi::*base_sync_is_dir_type)(bool&, saga::url);
typedef saga::task (base_cpi::*base_async_is_dir_type)(saga::url);
typedef void (Derived::*sync_is_dir_type)(bool&, saga::url);
typedef saga::task (Derived::*async_is_dir_type)(saga::url);
SAGA_REGISTER_MEMBER_EX(retval, info, base_cpi, Derived, is_dir, prefs,
base_sync_is_dir_type, base_async_is_dir_type,
sync_is_dir_type, async_is_dir_type);
typedef void (base_cpi::*base_sync_is_entry_type)(bool&, saga::url);
typedef saga::task (base_cpi::*base_async_is_entry_type)(saga::url);
typedef void (Derived::*sync_is_entry_type)(bool&, saga::url);
typedef saga::task (Derived::*async_is_entry_type)(saga::url);
SAGA_REGISTER_MEMBER_EX(retval, info, base_cpi, Derived, is_entry, prefs,
base_sync_is_entry_type, base_async_is_entry_type,
sync_is_entry_type, async_is_entry_type);
typedef void (base_cpi::*base_sync_is_link_type)(bool&, saga::url);
typedef saga::task (base_cpi::*base_async_is_link_type)(saga::url);
typedef void (Derived::*sync_is_link_type)(bool&, saga::url);
typedef saga::task (Derived::*async_is_link_type)(saga::url);
SAGA_REGISTER_MEMBER_EX(retval, info, base_cpi, Derived, is_link, prefs,
base_sync_is_link_type, base_async_is_link_type,
sync_is_link_type, async_is_link_type);
typedef void (base_cpi::*base_sync_copy_type)(saga::impl::void_t&, saga::url, saga::url, int);
typedef saga::task (base_cpi::*base_async_copy_type)(saga::url, saga::url, int);
typedef void (Derived::*sync_copy_type)(saga::impl::void_t&, saga::url, saga::url, int);
typedef saga::task (Derived::*async_copy_type)(saga::url, saga::url, int);
SAGA_REGISTER_MEMBER_EX(retval, info, base_cpi, Derived, copy, prefs,
base_sync_copy_type, base_async_copy_type,
sync_copy_type, async_copy_type);
typedef void (base_cpi::*base_sync_link_type)(saga::impl::void_t&, saga::url, saga::url, int);
typedef saga::task (base_cpi::*base_async_link_type)(saga::url, saga::url, int);
typedef void (Derived::*sync_link_type)(saga::impl::void_t&, saga::url, saga::url, int);
typedef saga::task (Derived::*async_link_type)(saga::url, saga::url, int);
SAGA_REGISTER_MEMBER_EX(retval, info, base_cpi, Derived, link, prefs,
base_sync_link_type, base_async_link_type,
sync_link_type, async_link_type);
typedef void (base_cpi::*base_sync_move_type)(saga::impl::void_t&, saga::url, saga::url, int);
typedef saga::task (base_cpi::*base_async_move_type)(saga::url, saga::url, int);
typedef void (Derived::*sync_move_type)(saga::impl::void_t&, saga::url, saga::url, int);
typedef saga::task (Derived::*async_move_type)(saga::url, saga::url, int);
SAGA_REGISTER_MEMBER_EX(retval, info, base_cpi, Derived, move, prefs,
base_sync_move_type, base_async_move_type,
sync_move_type, async_move_type);
typedef void (base_cpi::*base_sync_remove_type)(saga::impl::void_t&, saga::url, int);
typedef saga::task (base_cpi::*base_async_remove_type)(saga::url, int);
typedef void (Derived::*sync_remove_type)(saga::impl::void_t&, saga::url, int);
typedef saga::task (Derived::*async_remove_type)(saga::url, int);
SAGA_REGISTER_MEMBER_EX(retval, info, base_cpi, Derived, remove, prefs,
base_sync_remove_type, base_async_remove_type,
sync_remove_type, async_remove_type);
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, copy_wildcard, prefs);
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, link_wildcard, prefs);
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, move_wildcard, prefs);
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, remove_wildcard, prefs);
typedef void (base_cpi::*base_sync_open_type)(saga::name_space::entry&, saga::url, int);
typedef saga::task (base_cpi::*base_async_open_type)(saga::url, int);
typedef void (Derived::*sync_open_type)(saga::name_space::entry&, saga::url, int);
typedef saga::task (Derived::*async_open_type)(saga::url, int);
SAGA_REGISTER_MEMBER_EX(retval, info, base_cpi, Derived, open, prefs,
base_sync_open_type, base_async_open_type,
sync_open_type, async_open_type);
typedef void (base_cpi::*base_sync_open_dir_type)(saga::name_space::directory&, saga::url, int);
typedef saga::task (base_cpi::*base_async_open_dir_type)(saga::url, int);
typedef void (Derived::*sync_open_dir_type)(saga::name_space::directory&, saga::url, int);
typedef saga::task (Derived::*async_open_dir_type)(saga::url, int);
SAGA_REGISTER_MEMBER_EX(retval, info, base_cpi, Derived, open_dir, prefs,
base_sync_open_dir_type, base_async_open_dir_type,
sync_open_dir_type, async_open_dir_type);
typedef void (base_cpi::*base_sync_find_type)(std::vector<saga::url>&, std::string, int);
typedef saga::task (base_cpi::*base_async_find_type)(std::string, int);
typedef void (Derived::*sync_find_type)(std::vector<saga::url>&, std::string, int);
typedef saga::task (Derived::*async_find_type)(std::string, int);
SAGA_REGISTER_MEMBER_EX(retval, info, base_cpi, Derived, find, prefs,
base_sync_find_type, base_async_find_type,
sync_find_type, async_find_type);
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, permissions_allow, prefs);
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, permissions_deny, prefs);
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, permissions_allow_wildcard, prefs);
SAGA_REGISTER_MEMBER(retval, info, base_cpi, Derived, permissions_deny_wildcard, prefs);
infos.push_back(info);
SAGA_LOG(SAGA_VERBOSE_LEVEL_BLURB)
<< "end register_namespace_dir_functions";
return retval; // is true if at least one function got registered
}
/////////////////////////////////////////////////////////////////////////////
template <typename Derived, typename Mutex = boost::recursive_mutex>
class namespace_dir_cpi
: public saga::impl::v1_0::namespace_dir_cpi
{
protected:
typedef saga::impl::v1_0::namespace_dir_cpi base_type;
typedef saga::impl::proxy proxy;
typedef saga::impl::v1_0::cpi cpi;
typedef saga::impl::v1_0::cpi_info cpi_info;
typedef saga::impl::v1_0::preference_type preference_type;
typedef Mutex mutex_type;
mutex_type mtx_; // secure access to cpi_instance_data
public:
namespace_dir_cpi (proxy * p, cpi_info const& info,
TR1::shared_ptr<saga::adaptor> adaptor, cpi::flags flags)
: saga::impl::v1_0::namespace_dir_cpi (p, info, adaptor, flags)
{
}
~namespace_dir_cpi (void)
{
}
///////////////////////////////////////////////////////////////////////
// instance data
// data associated with the API object instance, i.e. visible to all
// CPI object instances associated with the API object instance
// regardless of the shared library (adaptor) they are implemented in.
typedef saga::adaptors::v1_0::namespace_dir_cpi_instance_data
ns_dir_instance_data;
friend class saga::adaptors::instance_data<ns_dir_instance_data>;
typedef saga::adaptors::instance_data<ns_dir_instance_data>
instance_data;
///////////////////////////////////////////////////////////////////////
// generic factory function
static cpi* cpi_maker (proxy* p, cpi_info const& info,
saga::ini::ini const& glob_ini, saga::ini::ini const& adap_ini,
TR1::shared_ptr<saga::adaptor> adaptor)
{
return new Derived (p, info, glob_ini, adap_ini, adaptor);
}
///////////////////////////////////////////////////////////////////////
// register implemented functions
static void
register_cpi(std::vector<cpi_info>& infos, preference_type prefs,
saga::uuid adaptor_uuid,
std::string const& cpi_name = saga::adaptors::namespace_dir_cpi)
{
// register namespace_entry CPI functions
saga::uuid cpi_uuid;
register_namespace_entry_functions<Derived>(infos,
&saga::adaptors::v1_0::namespace_dir_cpi<Derived>::cpi_maker,
prefs, cpi_uuid, adaptor_uuid, cpi_name);
// register namespace_dir CPI functions
register_namespace_dir_functions<Derived>(infos,
&saga::adaptors::v1_0::namespace_dir_cpi<Derived>::cpi_maker,
prefs, cpi_uuid, adaptor_uuid, cpi_name);
// register attribute CPI functions
register_attribute_functions<Derived>(infos,
&saga::adaptors::v1_0::namespace_dir_cpi<Derived>::cpi_maker,
prefs, cpi_uuid, adaptor_uuid, cpi_name);
// register permissions CPI functions
register_permissions_functions<Derived>(infos,
&saga::adaptors::v1_0::permissions_cpi<Derived>::cpi_maker,
prefs, cpi_uuid, adaptor_uuid, cpi_name);
}
///////////////////////////////////////////////////////////////////////
// generic up-cast of the impl pointer
TR1::shared_ptr<Derived> shared_from_this()
{
return TR1::static_pointer_cast<Derived>(
this->base_type::shared_from_this());
}
}; // class namespace_dir_cpi
///////////////////////////////////////////////////////////////////////////////
}}} // namespace saga::adaptors::v1_0
#if defined(__WAVE__) && defined(SAGA_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif // !defined(SAGA_DEBUG)
#endif // SAGA_IMPL_PACKAGES_DATA_NAMESPACE_NAMESPACEDIR_CPI_HPP
| 49.86533 | 136 | 0.651439 | [
"object",
"vector"
] |
02999136d561d1b85afddb9e34ddcf4d7827a48a | 3,813 | hpp | C++ | trie/include/wordsearch_solver/trie/trie.hpp | Arghnews/wordsearch_solver | cf25db64ca3d1facd9191aad075654f124f0d580 | [
"MIT"
] | null | null | null | trie/include/wordsearch_solver/trie/trie.hpp | Arghnews/wordsearch_solver | cf25db64ca3d1facd9191aad075654f124f0d580 | [
"MIT"
] | null | null | null | trie/include/wordsearch_solver/trie/trie.hpp | Arghnews/wordsearch_solver | cf25db64ca3d1facd9191aad075654f124f0d580 | [
"MIT"
] | null | null | null | #ifndef TRIE_HPP
#define TRIE_HPP
#include "wordsearch_solver/trie/node.hpp"
#include "wordsearch_solver/utility/flat_char_value_map.hpp"
#include <fmt/core.h>
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <fmt/ranges.h>
#include <algorithm>
#include <cstdint>
#include <initializer_list>
#include <iterator>
#include <ostream>
#include <string>
#include <string_view>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>
// TODO: test this with const_iterator not a std::tuple, and try a simple user
// defined struct/pointer to make trivial type to help the optimiser? Not even
// sure if "trivial" means what I think it does anyway, remove this likely..
// TODO: maybe look into units library for the ascii/index conversion stuff, as
// that has already wasted a significant amount of time with offset stuff
// TODO: std::bitset size on this system is 8 bytes, even though it need only be
// 4 bytes (26 bits) for lowercase ascii. Could see if writing own node without
// std::bitset that is 4 bytes big changes performance due to whole thing being
// approx half size (better for cache).
/** namespace trie */
namespace trie {
/** Recursive immutable node based trie.
*
* Recursive tree structure of nodes, where each node holds a vector-like
* container of edges, and each edge consists of a character and a pointer to
* the corresponding child node.
* To lookup a word of length "m", using a dictionary with "d" distinct
* characters, for example d == 26 for lowercase ascii and the English alphabet,
* lookup is O(m * d).
*
* Realistically, the factor of d will usually be much less
* than the actual value of d, so really more like just O(m). Could say that
* furthermore, since (in English at least) average word length is much shorter
* than max(m) anyway, essentially this becomes almost constant time lookup.
*
* @note Not thread safe even for just reading, due to use of unprotected
* internal cache.
*/
class Trie {
public:
Trie() = default;
Trie(Trie&&) = default;
Trie& operator=(Trie&&) = default;
/** @note See trie/include/wordsearch_solver/trie/node.hpp before
* changing/implementing this, must implement proper deep copy, traits don't
* behave nicely.
*/
Trie(const Trie&) = delete;
Trie& operator=(const Trie&) = delete;
Trie(const std::initializer_list<std::string_view>& words);
Trie(const std::initializer_list<std::string>& words);
Trie(const std::initializer_list<const char*>& words);
template <class Iterator1, class Iterator2>
Trie(Iterator1 first, const Iterator2 last);
// TODO: constrain this (sfinae or concepts(>=c++20))
// Strings should be a range of strings
template <class Strings> explicit Trie(Strings&& strings_in);
/** @copydoc solver::SolverDictWrapper::contains() */
bool contains(std::string_view word) const;
/** @copydoc solver::SolverDictWrapper::further() */
bool further(std::string_view word) const;
/** @copydoc solver::SolverDictWrapper::contains_further() */
template <class OutputIterator>
void contains_further(const std::string_view stem,
const std::string_view suffixes,
OutputIterator contains_further_it) const;
std::size_t size() const;
bool empty() const;
friend std::ostream& operator<<(std::ostream& os, const Trie& ct);
private:
const Node* search(std::string_view word) const;
std::pair<Node*, bool> insert(std::string_view word);
Node root_;
std::size_t size_;
mutable utility::FlatCharValueMap<const Node*> cache_;
};
namespace detail {
bool contains(const Node& node, std::string_view word);
bool further(const Node& node, std::string_view word);
} // namespace detail
} // namespace trie
#include "wordsearch_solver/trie/trie.tpp"
#endif // TRIE_HPP
| 32.589744 | 80 | 0.723839 | [
"vector"
] |
0299bf82d03d85f2a29c7daf5b0098462e977dd0 | 1,561 | cpp | C++ | main.cpp | husmen/Eight-Point-Algorithm-Cpp | 9019128948437c48c166eec5e7d6ccf2774bf80e | [
"MIT"
] | null | null | null | main.cpp | husmen/Eight-Point-Algorithm-Cpp | 9019128948437c48c166eec5e7d6ccf2774bf80e | [
"MIT"
] | null | null | null | main.cpp | husmen/Eight-Point-Algorithm-Cpp | 9019128948437c48c166eec5e7d6ccf2774bf80e | [
"MIT"
] | null | null | null | #include <iostream>
#include "EightPointAlgorithm.hpp"
using namespace std;
int main()
{
vector<Point2d> points_left, points_right;
double points_left_tmp[16] = {10, 20, 30, 50, 60, 80, 90, 120, 130, 170, 180, 230, 240, 300, 310, 380};
double points_right_tmp[16] = {20, 30, 40, 60, 70, 90, 100, 130, 140, 180, 190, 240, 250, 310, 320, 390};
for(int i = 0; i < 8; i++)
{
Point2d p1(points_left_tmp[2 * i], points_left_tmp[2 * i + 1]);
Point2d p2(points_right_tmp[2 * i], points_right_tmp[2 * i + 1]);
points_left.push_back(p1);
points_right.push_back(p2);
}
cout << points_left << endl;
cout << points_right << endl;
EightPointAlgorithm epa = EightPointAlgorithm();
Mat fMatrix = epa.F_Matrix_Eight_Point(points_left, points_right);
Mat fMatrixNorm = epa.F_Matrix_Normalized_Eight_Point(points_left, points_right);
cout << "\nFundamental Matrix is:" << endl;
cout << fMatrix.size() << fMatrix.type() << endl << fMatrix << endl;
cout << "\nNormalized Fundamental Matrix is:" << endl;
cout << fMatrixNorm.size() << fMatrixNorm.type() << endl << fMatrixNorm << endl;
//cout << "\nFundamental Matrix by OpenCV is:" << endl;
//Mat fundamentalMatrix = findFundamentalMat(points_left, points_right, FM_8POINT);
//cout << fundamentalMatrix.size() << fundamentalMatrix.type() << endl << fundamentalMatrix << endl;
Mat image_left(200, 400, CV_8UC3, Scalar(0,0, 100));
Mat image_right(200, 400, CV_8UC3, Scalar(0,100,0));
epa.Plot_Epipolar_lines(points_left, points_right, image_left, image_right);
} | 40.025641 | 107 | 0.682255 | [
"vector"
] |
029eeab2ab8c6ff7a5510f3f894e4ad9cf396ad2 | 3,287 | hpp | C++ | src/Evolution/EventsAndDenseTriggers/DenseTriggers/Or.hpp | fmahebert/spectre | 936e2dff0434f169b9f5b03679cd27794003700a | [
"MIT"
] | null | null | null | src/Evolution/EventsAndDenseTriggers/DenseTriggers/Or.hpp | fmahebert/spectre | 936e2dff0434f169b9f5b03679cd27794003700a | [
"MIT"
] | null | null | null | src/Evolution/EventsAndDenseTriggers/DenseTriggers/Or.hpp | fmahebert/spectre | 936e2dff0434f169b9f5b03679cd27794003700a | [
"MIT"
] | null | null | null | // Distributed under the MIT License.
// See LICENSE.txt for details.
#pragma once
#include <algorithm>
#include <memory>
#include <pup.h>
#include <vector>
#include "Evolution/EventsAndDenseTriggers/DenseTrigger.hpp"
#include "Options/Options.hpp"
#include "Options/ParseOptions.hpp"
#include "Parallel/CharmPupable.hpp"
#include "Time/EvolutionOrdering.hpp"
#include "Time/TimeStepId.hpp"
#include "Utilities/Algorithm.hpp"
#include "Utilities/TMPL.hpp"
/// \cond
namespace Parallel {
template <typename Metavariables>
class GlobalCache;
} // namespace Parallel
namespace Tags {
struct DataBox;
struct TimeStepId;
} // namespace Tags
namespace db {
template <typename TagsList> class DataBox;
} // namespace db
/// \endcond
namespace DenseTriggers {
/// \ingroup EventsAndTriggersGroup
/// Trigger when any of a collection of DenseTriggers triggers.
class Or : public DenseTrigger {
public:
/// \cond
Or() = default;
explicit Or(CkMigrateMessage* const msg) noexcept : DenseTrigger(msg) {}
using PUP::able::register_constructor;
WRAPPED_PUPable_decl_template(Or); // NOLINT
/// \endcond
static constexpr Options::String help =
"Trigger when any of a collection of triggers triggers.";
explicit Or(std::vector<std::unique_ptr<DenseTrigger>> triggers) noexcept;
using is_triggered_argument_tags =
tmpl::list<Tags::TimeStepId, Tags::DataBox>;
template <typename DbTags>
Result is_triggered(const TimeStepId& time_step_id,
const db::DataBox<DbTags>& box) const noexcept {
const evolution_less<double> before{time_step_id.time_runs_forward()};
Result result{false, before.infinity()};
for (const auto& trigger : triggers_) {
const auto sub_result = trigger->is_triggered(box);
if (sub_result.is_triggered) {
// We can't short-circuit because we need to make sure we
// report the next time that any of the triggers wants to be
// checked, whether they triggered now or not.
result.is_triggered = true;
}
result.next_check =
std::min(sub_result.next_check, result.next_check, before);
}
return result;
}
using is_ready_argument_tags = tmpl::list<Tags::DataBox>;
template <typename Metavariables, typename ArrayIndex, typename Component,
typename DbTags>
bool is_ready(Parallel::GlobalCache<Metavariables>& cache,
const ArrayIndex& array_index, const Component* const component,
const db::DataBox<DbTags>& box) const noexcept {
return alg::all_of(
triggers_,
[&array_index, &box, &cache, &component](
const std::unique_ptr<DenseTrigger>& trigger) noexcept {
return trigger->is_ready(box, cache, array_index, component);
});
}
// NOLINTNEXTLINE(google-runtime-references)
void pup(PUP::er& p) noexcept override;
private:
std::vector<std::unique_ptr<DenseTrigger>> triggers_{};
};
} // namespace DenseTriggers
template <>
struct Options::create_from_yaml<DenseTriggers::Or> {
template <typename Metavariables>
static DenseTriggers::Or create(const Option& options) {
return DenseTriggers::Or(
options.parse_as<std::vector<std::unique_ptr<DenseTrigger>>,
Metavariables>());
}
};
| 31.304762 | 80 | 0.700943 | [
"vector"
] |
029faec694784f65d0e7f03359baa593acb1f2fe | 16,726 | cpp | C++ | src/level.cpp | prinsij/RogueReborn | 20e6ba4d2e61a47283747ba207a758e604fa89d9 | [
"BSD-3-Clause"
] | null | null | null | src/level.cpp | prinsij/RogueReborn | 20e6ba4d2e61a47283747ba207a758e604fa89d9 | [
"BSD-3-Clause"
] | null | null | null | src/level.cpp | prinsij/RogueReborn | 20e6ba4d2e61a47283747ba207a758e604fa89d9 | [
"BSD-3-Clause"
] | null | null | null | /**
* @file level.cpp
* @author Team Rogue++
* @date December 08, 2016
*
* @brief Member definitions for the Level class
*/
#include <algorithm>
#include <iostream>
#include <iterator>
#include <map>
#include <math.h>
#include <queue>
#include <tuple>
#include <vector>
#include "include/amulet.h"
#include "include/armor.h"
#include "include/coord.h"
#include "include/debug.h"
#include "include/feature.h"
#include "include/food.h"
#include "include/globals.h"
#include "include/goldpile.h"
#include "include/level.h"
#include "include/mob.h"
#include "include/monster.h"
#include "include/playerchar.h"
#include "include/potion.h"
#include "include/random.h"
#include "include/ring.h"
#include "include/room.h"
#include "include/scroll.h"
#include "include/stairs.h"
#include "include/terrain.h"
#include "include/tiles.h"
#include "include/trap.h"
#include "include/tunnel.h"
#include "include/wand.h"
#include "include/weapon.h"
Level::Level(int depth, PlayerChar* player)
: player(player)
, size(getSize())
, depth(depth)
{
for (auto x=0; x < size[0]; x++) {
tiles.push_back(std::vector<Terrain>());
for (auto y=0; y < size[1]; y++) {
tiles[x].push_back(Wall());
}
}
}
void Level::clear(){
for (auto i = 0; i < size[0]; i++){
tiles[i].clear();
}
tiles.clear();
for (auto x=0; x < size[0]; x++) {
tiles.push_back(std::vector<Terrain>());
for (auto y=0; y < size[1]; y++) {
tiles[x].push_back(Floor());
}
}
}
std::vector<Feature*>& Level::getFeatures() {
return features;
}
int Level::getDepth() {
return depth;
}
PlayerChar* Level::getPlayer() {
return player;
}
Terrain& Level::operator[](Coord coord) {
return tileAt(coord);
}
Terrain& Level::tileAt(Coord coord) {
return tiles[coord[0]][coord[1]];
}
bool Level::contains(Coord pos) {
return pos[0] >= 0 && pos[1] >= 0 && pos[0] < size[0] && pos[1] < size[1];
}
int Level::genGoldAmount() {
return 2 + Generator::intFromRange(0, 50 + 10 * depth);
}
std::vector<Room>& Level::getRooms() {
return rooms;
}
void Level::registerMob(Mob* mob) {
mobs.push_back(ClockItem(mob, 0));
}
void Level::removeMob(Mob* mob) {
#ifdef DEBUG
std::cout << "removeMob " << mob->getName() << "\n";
#endif
for (auto it=mobs.begin(); it != mobs.end(); ++it) {
if (it->mob == mob) {
mobs.erase(it);
break;
}
}
}
std::tuple<Mob*, int> Level::popTurnClock() {
if (mobs.empty()) {
return std::tuple<Mob*, int>(NULL, 0);
}
auto difference = mobs.back().delay;
if (difference > 0) {
for (auto &item : mobs) {
item.delay -= difference;
}
}
return std::tuple<Mob*, int>(mobs.back().mob, difference);
}
void Level::pushMob(Mob* which, int delay) {
auto newTime = delay;
for (auto it=mobs.begin(); it != mobs.end(); ++it) {
auto& item = *it;
if (item.mob == which) {
mobs.erase(it);
newTime += item.delay;
break;
}
}
/*for (ClockItem& item : mobs) {
std::cout << item.mob->getName() << " " << item.delay << "\n";
}*/
if (mobs.empty()) {
mobs.push_back(ClockItem(which, newTime));
return;
}
for (auto it=mobs.begin(); it != mobs.end(); ++it) {
auto& item = *it;
if (item.delay <= newTime) {
mobs.insert(it, ClockItem(which, newTime));
return;
}
}
mobs.insert(mobs.end(), ClockItem(which, newTime));
}
std::vector<Mob*> Level::getMobs() {
std::vector<Mob*> result;
for (auto &item : mobs) {
result.push_back(item.mob);
}
return result;
}
void Level::generate() {
Coord maxRoomSize = Coord(size[0]/3, size[1]/3);
for (auto i=0; i < MAX_ROOMS; i++) {
//Define upper left corner
Coord totalTopLeft = Coord((i%3)*maxRoomSize[0], i/3*maxRoomSize[1]);
Coord padding = Coord(ROOM_PADDING, ROOM_PADDING);
//These two are INCLUSIVE legal constraints (<= and >=)
Coord legalTopLeft = totalTopLeft + padding;
Coord legalBottomRight = totalTopLeft + maxRoomSize - padding - Coord(1,1);
Coord roomSize = Coord( Generator::intFromRange(MIN_ROOM_DIM, legalBottomRight[0] - legalTopLeft[0] + 1),
Generator::intFromRange(MIN_ROOM_DIM, legalBottomRight[1] - legalTopLeft[1] + 1));
bool dne = false;
//If room DNE, set its size to 1x1
if (Generator::rand() > ROOM_EXIST_CHANCE){
roomSize = Coord(1,1);
dne = true;
}
Coord roomPosition = Coord( Generator::intFromRange(legalTopLeft[0], legalBottomRight[0] - roomSize[0] + 1),
Generator::intFromRange(legalTopLeft[1], legalBottomRight[1] - roomSize[1] + 1));
//Really not sure what the purpose of this line is. Why is this being decided randomly?
Room::Darkness isDark = Generator::intFromRange(0, 10) < depth - 1 ? Room::DARK : Room::LIT;
Room curRoom = Room(roomPosition, roomPosition + roomSize - Coord(1,1), isDark, Room::WORTHLESS, Room::VISIBLE, Coord(i%3, i/3), !dne);
curRoom.dig(*this);
//put monsters in current room
rooms.push_back(curRoom);
}
//Used to say: If A -> B, then B -> A
bool symmetric [MAX_ROOMS_DEF][MAX_ROOMS_DEF] = {};//Take care of non-existent rooms
for (auto i=0; i < MAX_ROOMS; i++){
int j;
//Down
j = i + 3;
if (j <= 8){
addTunnel(i, j, &symmetric[i][j], &symmetric[j][i]);
}
//Up
j = i - 3;
if (j >= 0){
addTunnel(i, j, &symmetric[i][j], &symmetric[j][i]);
}
//Left
j = i - 1;
if (j >= 0 && i / 3 == j / 3){
addTunnel(i, j, &symmetric[i][j], &symmetric[j][i]);
}
//Right
j = i + 1;
if (j >= 0 && i / 3 == j / 3){
addTunnel(i, j, &symmetric[i][j], &symmetric[j][i]);
}
}
for (Tunnel t : tunnels){
t.dig(*this);
}
// Place mobs
for (int i=0; i < 40; i++) {
Coord randPos = Coord(Generator::intFromRange(0, X_SIZE-1),
Generator::intFromRange(0, Y_SIZE-1));
if (tileAt(randPos).isPassable() == Terrain::Passable && !monsterAt(randPos)) {
std::vector<char> monsterSymbols = Monster::getSymbolsForLevel(depth);
if (monsterSymbols.size() > 0) {
char monsterSymbol = monsterSymbols[Generator::intFromRange(0, monsterSymbols.size() - 1)];
Mob* m = new Monster(monsterSymbol, randPos);
#ifdef DEBUG
std::cout << "Creating " << m->getName() << " at: " << randPos.toString() << std::endl;
#endif
registerMob(m);
}
}
}
// Place staircase
while (true) {
Coord randPos = Coord(Generator::intFromRange(0, X_SIZE-1),
Generator::intFromRange(0, Y_SIZE-1));
if (tileAt(randPos).isPassable() == Terrain::Passable) {
for (Room& r : rooms) {
if (r.contains(randPos)) {
features.push_back(new Stairs(randPos, !(depth == NUM_LEVELS || player->hasAmulet())));
goto stair_exit;
}
}
}
}
stair_exit:;
if (depth == NUM_LEVELS) {
Coord randPos;
do {
try_again:;
randPos = Coord(Generator::intFromRange(0, X_SIZE-1),
Generator::intFromRange(0, Y_SIZE-1));
for (auto feat : features) {
if (feat->getLocation() == randPos) {
goto try_again;
}
}
} while (tileAt(randPos).isPassable() != Terrain::Passable);
features.push_back(new Amulet(randPos, Item::FLOOR));
}
// Place gold
int i = 0;
while (i < THINGS_PER_KIND) {
Coord randPos = Coord(Generator::intFromRange(0, X_SIZE-1),
Generator::intFromRange(0, Y_SIZE-1));
if (tileAt(randPos).isPassable() == Terrain::Passable) {
features.push_back(new GoldPile(randPos, Generator::intFromRange(1, 35*depth)));
#ifdef DEBUG
std::cout << "Put gold at " << randPos.toString() << std::endl;
#endif
++i;
}
}
i = 0;
while (i < THINGS_PER_KIND) {
Coord randPos = Coord(Generator::intFromRange(0, X_SIZE-1),
Generator::intFromRange(0, Y_SIZE-1));
if (tileAt(randPos).isPassable() == Terrain::Passable) {
features.push_back(new Potion(randPos));
++i;
}
}
i = 0;
while (i < THINGS_PER_KIND) {
Coord randPos = Coord(Generator::intFromRange(0, X_SIZE-1),
Generator::intFromRange(0, Y_SIZE-1));
if (tileAt(randPos).isPassable() == Terrain::Passable) {
features.push_back(new Trap(randPos, Generator::intFromRange(0, Trap::MAX_TYPE), false));
++i;
}
}
i = 0;
while (i < THINGS_PER_KIND) {
Coord randPos = Coord(Generator::intFromRange(0, X_SIZE-1),
Generator::intFromRange(0, Y_SIZE-1));
if (tileAt(randPos).isPassable() == Terrain::Passable) {
features.push_back(new Food(randPos, Item::FLOOR));
++i;
}
}
i = 0;
while (i < THINGS_PER_KIND) {
Coord randPos = Coord(Generator::intFromRange(0, X_SIZE-1),
Generator::intFromRange(0, Y_SIZE-1));
if (tileAt(randPos).isPassable() == Terrain::Passable) {
features.push_back(new Ring(randPos));
++i;
}
}
i = 0;
while (i < THINGS_PER_KIND) {
Coord randPos = Coord(Generator::intFromRange(0, X_SIZE-1),
Generator::intFromRange(0, Y_SIZE-1));
if (tileAt(randPos).isPassable() == Terrain::Passable) {
features.push_back(new Armor(randPos));
++i;
}
}
i = 0;
while (i < THINGS_PER_KIND) {
Coord randPos = Coord(Generator::intFromRange(0, X_SIZE-1),
Generator::intFromRange(0, Y_SIZE-1));
if (tileAt(randPos).isPassable() == Terrain::Passable) {
features.push_back(new Weapon(randPos));
++i;
}
}
i = 0;
while (i < THINGS_PER_KIND) {
Coord randPos = Coord(Generator::intFromRange(0, X_SIZE-1),
Generator::intFromRange(0, Y_SIZE-1));
if (tileAt(randPos).isPassable() == Terrain::Passable) {
features.push_back(new Wand(randPos));
++i;
}
}
i = 0;
while (i < THINGS_PER_KIND) {
Coord randPos = Coord(Generator::intFromRange(0, X_SIZE-1),
Generator::intFromRange(0, Y_SIZE-1));
if (tileAt(randPos).isPassable() == Terrain::Passable) {
features.push_back(new Scroll(randPos));
++i;
}
}
this->placePlayerInStartingPosition();
}
void Level::addTunnel(int i, int j, bool* a, bool* b){
if (!(*a)){
*a = true;
*b = true;
tunnels.push_back(Tunnel(&rooms[i], &rooms[j]));
}
}
void Level::tryAddPassable(Coord current, std::queue<Coord>& q, Coord target, Coord end){
if (target[0] > 0 && target[0] < size[0] && target[1] > 0 && target[1] < size[1]){
if(tiles[target[0]][target[1]].isPassable() == Terrain::Passable && !(tiles[target[0]][target[1]].checked) && ( end == target || !monsterAt(target))){
Coord c_ = current.copy();
Coord p_ = target.copy();
q.push(p_);
tiles[target[0]][target[1]].checked = true;
tiles[target[0]][target[1]].parent = c_;
}
}
}
void Level::tryAdd(Coord current, std::queue<Coord>& q, Coord target){
if (target[0] > 0 && target[0] < size[0] && target[1] > 0 && target[1] < size[1]){
if(!(tiles[target[0]][target[1]].checked)){
Coord c_ = current.copy();
Coord p_ = target.copy();
q.push(p_);
tiles[target[0]][target[1]].checked = true;
tiles[target[0]][target[1]].parent = c_;
}
}
}
std::vector<Coord> Level::bfsDiag(Coord start, Coord end){
resetPF();
std::queue<Coord> q;
q.push(start.copy());
while(!q.empty()){
Coord current = q.front().copy();
q.pop();
if (current == end){
break;
}
Coord target;
target = current + Coord(1, 0);
tryAddPassable(current, q, target, end);
target = current + Coord(-1, 0);
tryAddPassable(current, q, target, end);
target = current + Coord(0, 1);
tryAddPassable(current, q, target, end);
target = current + Coord(0, -1);
tryAddPassable(current, q, target, end);
target = current + Coord(1, 1);
tryAddPassable(current, q, target, end);
target = current + Coord(-1, 1);
tryAddPassable(current, q, target, end);
target = current + Coord(1, -1);
tryAddPassable(current, q, target, end);
target = current + Coord(-1, -1);
tryAddPassable(current, q, target, end);
}
std::vector<Coord> path = traceBack(end, start);
return path;
}
std::vector<Coord> Level::bfsPerp(Coord start, Coord end){
resetPF();
std::queue<Coord> q;
q.push(start.copy());
while(!q.empty()){
Coord current = q.front().copy();
q.pop();
if (current == end){
break;
}
Coord target;
target = current + Coord(1, 0);
tryAdd(current, q, target);
target = current + Coord(-1, 0);
tryAdd(current, q, target);
target = current + Coord(0, 1);
tryAdd(current, q, target);
target = current + Coord(0, -1);
tryAdd(current, q, target);
}
std::vector<Coord> path = traceBack(end, start);
return path;
}
void Level::resetPF(){
for (auto x=0; x < size[0]; x++) {
for (auto y=0; y < size[1]; y++) {
tiles[x][y].checked = false;
tiles[x][y].parent = Coord(0,0);
}
}
}
std::vector<Coord> Level::traceBack(Coord end, Coord start){
std::vector<Coord> path;
Coord current = end.copy();
int count = 0;
while(current != start){
Coord c_ = current.copy();
path.push_back(c_);
if (current == tiles[current[0]][current[1]].parent){
#ifdef DEBUG
std::cout << "Dead end in trace-back" << std::endl;
#endif
break;
}
current = tiles[current[0]][current[1]].parent.copy();
count++;
if (count == 500){
#ifdef DEBUG
std::cout << "Path too long! (500)" << std::endl;
#endif
std::vector<Coord> nothing;
return nothing;//This used to just break. returning it MAY screw up the tunnel tests. Consult Ori Almog
}
}
path.push_back(start.copy());
std::reverse(path.begin(), path.end());
return path;
}
std::vector<Coord> Level::getAdjPassable(Coord ori, bool noMonster){
std::vector<Coord> sample;
for (Coord& ortho : Coord::ORTHO) {
Coord adj = ortho + ori;
if (contains(adj) && tileAt(adj).isPassable() == Terrain::Passable) {
if (!noMonster || !monsterAt(adj) ) {
sample.push_back(adj);
}
}
}
return sample;
}
bool Level::canSee(Coord a, Coord b){
for (auto r : rooms){
if (r.contains(a) && r.contains(b)){
return true;
}
}
return false;
}
Coord Level::throwLocation(Coord start, Coord dir){
Coord step = start.copy();
while((*this)[step].isPassable() && !monsterAt(step)){
step = step + dir;
}
return step;
}
Mob* Level::monsterAt(Coord s){
for (ClockItem c : mobs){
if (c.mob->getLocation() == s){
return c.mob;
}
}
return NULL;
}
Level::~Level() {
for (Feature* feat : features) {
delete feat;
}
for (auto& item : mobs) {
auto* pc = dynamic_cast<PlayerChar*>(item.mob);
if (pc == NULL) {
delete item.mob;
}
}
}
//Still doing BFS twice
std::vector<Coord> Level::getNearestGold(Coord ori) {
resetPF();
std::queue<Coord> q;
q.push(ori.copy());
tileAt(ori).checked = true;
GoldPile* near = nullptr;
Coord current = q.front().copy();
while(q.size() > 0){
current = q.front().copy();
q.pop();
for (Feature* f : features){
GoldPile* pile = dynamic_cast<GoldPile*>(f);
if (pile != NULL){
if (pile->getLocation() == current){
near = pile;
goto found_gold;
}
}
}
if (contains(current + Coord(1,0)) && !tileAt(current + Coord(1,0)).checked && tileAt(current + Coord(1,0)).isPassable() == Terrain::Passable){
q.push(current + Coord(1,0));
tileAt(current + Coord(1,0)).checked = true;
}
if (contains(current + Coord(-1,0)) && !tileAt(current + Coord(-1,0)).checked && tileAt(current + Coord(-1,0)).isPassable() == Terrain::Passable){
q.push(current + Coord(-1,0));
tileAt(current + Coord(-1,0)).checked = true;
}
if (contains(current + Coord(0,1)) && !tileAt(current + Coord(0,1)).checked && tileAt(current + Coord(0,1)).isPassable() == Terrain::Passable){
q.push(current + Coord(0,1));
tileAt(current + Coord(0,1)).checked = true;
}
if (contains(current + Coord(0,-1)) && !tileAt(current + Coord(0,-1)).checked && tileAt(current + Coord(0,-1)).isPassable() == Terrain::Passable){
q.push(current + Coord(0,-1));
tileAt(current + Coord(0,-1)).checked = true;
}
}
found_gold:;
if (near != nullptr){
return bfsDiag(ori, near->getLocation());
} else {
// Stopping the spam onslaught temporarily
// std::cout << "Can't find gold pile! This is an issue!" << std::endl;
return {};
}
}
void Level::removeFeature(Feature* feat) {
features.erase(std::find(
features.begin(),
features.end(), feat));
}
void Level::addFeature(Feature* feat) {
features.push_back(feat);
}
void Level::placePlayerInStartingPosition() {
int roomIndex = 0;
int count = 0;
do {
roomIndex = Generator::intFromRange(0,rooms.size()-1);
count++;
} while (!rooms[roomIndex].exists());
player->move(Generator::randPosition(rooms[roomIndex].getPosition1(), rooms[roomIndex].getPosition2()), this);
}
Coord Level::getRandomEmptyPosition() {
Coord result;
do {
result = Generator::randPosition(Coord(0,0), Coord(X_SIZE-1, Y_SIZE-1));
} while (tileAt(result).isPassable() != Terrain::Passable || monsterAt(result) != NULL);
return result;
}
void Level::putRandomMonster() {
auto possibilities = Monster::getSymbolsForLevel(depth);
auto monsterSymbol = possibilities[Generator::intFromRange(0, possibilities.size()-1)];
registerMob(new Monster(monsterSymbol, getRandomEmptyPosition()));
}
| 23.458626 | 152 | 0.630396 | [
"vector"
] |
02ada0a3f084672595ec6b3b54c8b96f442f45f5 | 1,384 | hpp | C++ | include/actl/geometry/algorithm/intersect/line_sphere.hpp | AlCash07/ACTL | 15de4e2783d8e39dbd8e10cd635aaab328ca4f5b | [
"BSL-1.0"
] | 17 | 2018-08-22T06:48:20.000Z | 2022-02-22T21:20:09.000Z | include/actl/geometry/algorithm/intersect/line_sphere.hpp | AlCash07/ACTL | 15de4e2783d8e39dbd8e10cd635aaab328ca4f5b | [
"BSL-1.0"
] | null | null | null | include/actl/geometry/algorithm/intersect/line_sphere.hpp | AlCash07/ACTL | 15de4e2783d8e39dbd8e10cd635aaab328ca4f5b | [
"BSL-1.0"
] | null | null | null | // Copyright 2017 Oleksandr Bacherikov.
//
// Distributed under the Boost Software License, Version 1.0
// (see accompanying file LICENSE.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
#pragma once
#include <actl/geometry/algorithm/area/point_line.hpp>
#include <actl/geometry/algorithm/intersect/intersect.hpp>
#include <actl/geometry/detail/line_test.hpp>
#include <actl/geometry/sphere.hpp>
namespace ac {
template <class Policy, index N, class T0, class K, class T1, class OutIter>
OutIter intersect(
line_scalar_policy<Policy> lsp,
const line<T0, N, K>& l,
const sphere<T1, N>& s,
OutIter dst)
{
auto& policy = lsp.policy;
auto vdot = dot(policy, l.vector);
auto delta = product(policy, vdot, sqr(policy, s.radius)) -
sqr(policy, area(policy, s.center, l));
int delta_sgn = sgn(policy, delta);
if (delta_sgn < 0)
return dst;
auto projection = dot(policy, s.center - l.begin, l.vector);
auto output = [&](const auto& x)
{
if (detail::line_test(policy, l.kind(), x, vdot))
{
*dst++ = ratio(policy, x, vdot);
}
};
if (delta_sgn == 0)
{
output(projection);
}
else
{
auto offset = sqrt(policy, delta);
output(projection - offset);
output(projection + offset);
}
return dst;
}
} // namespace ac
| 26.615385 | 76 | 0.621387 | [
"geometry",
"vector"
] |
02bb43a1a9f87da7035d3ecda7528e7753e9e0e2 | 2,917 | cpp | C++ | CS33901/mzrimsek/assignment03/aps/ImplementationModel/src/UseCaseTester.cpp | mzrimsek/school | d8791e3b94e883a771d0546b3729f3cbd18921c0 | [
"MIT"
] | null | null | null | CS33901/mzrimsek/assignment03/aps/ImplementationModel/src/UseCaseTester.cpp | mzrimsek/school | d8791e3b94e883a771d0546b3729f3cbd18921c0 | [
"MIT"
] | 2 | 2015-01-30T17:49:32.000Z | 2015-02-04T02:17:17.000Z | CS33901/mzrimsek/assignment03/aps/ImplementationModel/src/UseCaseTester.cpp | mzrimsek/School | d8791e3b94e883a771d0546b3729f3cbd18921c0 | [
"MIT"
] | null | null | null | #include "Terminal.h"
#include "Models/Vehicle.h"
#include "Models/Customer.h"
#include "Models/Ticket.h"
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
Vehicle* createVehicle(string fileName)
{
ifstream inputFile(fileName.c_str());
string* lines = new string[6];
if(inputFile.is_open())
{
int index = 0;
while(getline(inputFile, lines[index]))
{
index++;
}
}
inputFile.close();
string licensePlate = lines[0];
string make = lines[1];
string model = lines[2];
int year = stoi(lines[3]);
double weight = stod(lines[4]);
int wheels = stoi(lines[5]);
return new Vehicle(licensePlate, make, model, year, weight, wheels);
}
Customer* createCustomer(string fileName)
{
ifstream inputFile(fileName.c_str());
string* lines = new string[3];
if(inputFile.is_open())
{
int index = 0;
while(getline(inputFile, lines[index]))
{
index++;
}
}
inputFile.close();
string firstName = lines[0];
string lastName = lines[1];
bool isMember = lines[2].compare("True")==0;
return new Customer(firstName, lastName, isMember);
}
void loadVehicleAndCustomer(Terminal* terminal, string vehicleFile, string customerFile)
{
Vehicle* vehicle = createVehicle(vehicleFile);
Customer* customer = createCustomer(customerFile);
terminal->SetCurrentVehicle(vehicle);
terminal->SetCurrentCustomer(customer);
}
void testAddAndRetrieveValidVehicle()
{
cout << "Testing adding and retrieving valid vehicle" << "\n\n";
int totalSpaces = 100;
AutomatedParkingStructure* aps = new AutomatedParkingStructure(totalSpaces);
Terminal* terminal = new Terminal(aps);
loadVehicleAndCustomer(terminal, "inputs/validVehicle.txt", "inputs/nonMemberCustomer.txt");
Ticket ticket = terminal->StoreCurrentVehicle();
int availableSpaces = aps->GetAvailableSpaces();
if(availableSpaces == 99)
{
cout << "Vehicle added!" << "\n";
}
terminal->RetrieveVehicle(ticket);
availableSpaces = aps->GetAvailableSpaces();
if(availableSpaces == 100)
{
cout << "Vehicle retrieved!" << "\n";
}
}
void testRejectInvalidVehicle()
{
cout << "Testing adding and retrieving invalid vehicle" << "\n\n";
int totalSpaces = 100;
AutomatedParkingStructure* aps = new AutomatedParkingStructure(totalSpaces);
Terminal* terminal = new Terminal(aps);
loadVehicleAndCustomer(terminal, "inputs/invalidVehicle.txt", "inputs/nonMemberCustomer.txt");
terminal->StoreCurrentVehicle();
int availableSpaces = aps->GetAvailableSpaces();
if(availableSpaces == 100)
{
cout << "Vehicle correctly rejected!" << "\n";
}
}
int main()
{
testAddAndRetrieveValidVehicle();
cout << "\n";
testRejectInvalidVehicle();
return 0;
} | 25.146552 | 98 | 0.655468 | [
"model"
] |
02c0af832872c62f6cb61edbebaba568b1f2c3e0 | 2,266 | cpp | C++ | examples/demo_common/PartDatabase.cpp | rafael-radkowski/TrackingExpert- | 007310637e1582d9623e518510d5d9eccaa23c2c | [
"MIT"
] | 26 | 2020-02-28T06:20:36.000Z | 2021-12-09T09:52:06.000Z | examples/demo_common/PartDatabase.cpp | rafael-radkowski/TrackingExpert- | 007310637e1582d9623e518510d5d9eccaa23c2c | [
"MIT"
] | 6 | 2020-02-19T15:04:27.000Z | 2021-08-15T20:32:08.000Z | examples/demo_common/PartDatabase.cpp | rafael-radkowski/TrackingExpert- | 007310637e1582d9623e518510d5d9eccaa23c2c | [
"MIT"
] | 5 | 2020-07-09T18:58:34.000Z | 2021-08-16T00:40:06.000Z | #include "PartDatabase.h"
Model* findModel(std::unordered_map<int, Model*> models, std::string name)
{
for (std::pair<int, Model*> p : models)
{
if (p.second->name.compare(name) == 0)
{
return p.second;
}
}
return NULL;
}
PartDatabase::PartDatabase()
{
models = std::unordered_map<int, Model*>();
size = 0;
}
PartDatabase::~PartDatabase()
{
}
bool PartDatabase::loadObjsFromFile(const char* path)
{
models.clear();
ifstream objList(path);
if (!objList)
{
cout << "ERROR: PartDatabase: loadObjsFromFile: Failed to open file: " << path << "\n";
return false;
}
char fileLine[100];
int idx = 0;
Model* nModel;
while (!objList.eof())
{
nModel = new Model();
objList.getline(fileLine, 100);
if (std::experimental::filesystem::exists(fileLine))
{
nModel->model->create(fileLine);
nModel->visible = false;
nModel->name = std::experimental::filesystem::path(fileLine).filename().string();
nModel->duplicates = 0;
}
else
{
nModel->name = "null";
nModel->visible = false;
cout << "WARNING: PartDatabase: File " << fileLine << " does not exist. It will be ignored.\n";
}
models.insert(std::make_pair(idx, nModel));
idx++;
}
size = idx;
return true;
}
bool PartDatabase::setNumDuplicates(const char* name, int num_dupes)
{
if (num_dupes < 0)
{
cout << "WARNING: PartDatabase: setNumDuplicates: Cannot set a negative amount of duplicates. Number of duplicates not set." << endl;
return false;
}
Model* ref_model = findModel(models, name);
if (ref_model == NULL) return false;
if (num_dupes == ref_model->duplicates) return false;
if (num_dupes > ref_model->duplicates)
{
Model* dModel;
char* new_name = (char*)malloc(100 * sizeof(char));
for (int i = ref_model->duplicates; i <= num_dupes; i++)
{
sprintf(new_name, "%s-%d", name, i);
if (findModel(models, new_name) != NULL) continue;
dModel = new Model();
dModel->model = new cs557::OBJModel(*ref_model->model);
dModel->name = std::string(new_name);
models.insert(std::make_pair(size, dModel));
size++;
}
}
ref_model->duplicates = num_dupes;
return true;
}
void PartDatabase::setModelPos(const char* name, glm::mat4 pos)
{
findModel(models, name)->model->setModelMatrix(pos);
} | 19.877193 | 136 | 0.657988 | [
"model"
] |
02c57cf1549f32b3273b8db9a108f8730aac9c0a | 671 | cpp | C++ | daily_challenge/February_LeetCoding_Challenge_2021/longestHarmoniousSubsequence.cpp | archit-1997/LeetCode | 7c0f74da0836d3b0855f09bae8960f81a384f3f3 | [
"MIT"
] | 1 | 2021-01-27T16:37:36.000Z | 2021-01-27T16:37:36.000Z | daily_challenge/February_LeetCoding_Challenge_2021/longestHarmoniousSubsequence.cpp | archit-1997/LeetCode | 7c0f74da0836d3b0855f09bae8960f81a384f3f3 | [
"MIT"
] | null | null | null | daily_challenge/February_LeetCoding_Challenge_2021/longestHarmoniousSubsequence.cpp | archit-1997/LeetCode | 7c0f74da0836d3b0855f09bae8960f81a384f3f3 | [
"MIT"
] | null | null | null | class Solution {
public:
int findLHS(vector<int> &nums) {
map<int, int> hash;
int n = nums.size();
for (int i = 0; i < n; i++)
hash[nums[i]]++;
if (hash.size() <= 1)
return 0;
int ans = INT_MIN;
vector<pair<int, int>> v;
for (auto it = hash.begin(); it != hash.end(); it++) {
v.push_back(make_pair(it->first, it->second));
}
int len = v.size();
for (int i = 0; i < len - 1; i++) {
int diff = v[i + 1].first - v[i].first;
if (diff == 1) {
int sum = v[i].second + v[i + 1].second;
ans = max(ans, sum);
}
}
if (ans == INT_MIN)
return 0;
return ans;
}
};
| 19.735294 | 58 | 0.469449 | [
"vector"
] |
02ca4ea98d0be205c444593aa0c2262dde5876b7 | 2,219 | cc | C++ | ivpd/src/model/CreateSegmentBodyJobRequest.cc | iamzken/aliyun-openapi-cpp-sdk | 3c991c9ca949b6003c8f498ce7a672ea88162bf1 | [
"Apache-2.0"
] | 89 | 2018-02-02T03:54:39.000Z | 2021-12-13T01:32:55.000Z | ivpd/src/model/CreateSegmentBodyJobRequest.cc | iamzken/aliyun-openapi-cpp-sdk | 3c991c9ca949b6003c8f498ce7a672ea88162bf1 | [
"Apache-2.0"
] | 89 | 2018-03-14T07:44:54.000Z | 2021-11-26T07:43:25.000Z | ivpd/src/model/CreateSegmentBodyJobRequest.cc | aliyun/aliyun-openapi-cpp-sdk | 0cf5861ece17dfb0bb251f13bf3fbdb39c0c6e36 | [
"Apache-2.0"
] | 69 | 2018-01-22T09:45:52.000Z | 2022-03-28T07:58:38.000Z | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/ivpd/model/CreateSegmentBodyJobRequest.h>
using AlibabaCloud::Ivpd::Model::CreateSegmentBodyJobRequest;
CreateSegmentBodyJobRequest::CreateSegmentBodyJobRequest() :
RpcServiceRequest("ivpd", "2019-06-25", "CreateSegmentBodyJob")
{
setMethod(HttpRequest::Method::Post);
}
CreateSegmentBodyJobRequest::~CreateSegmentBodyJobRequest()
{}
std::vector<CreateSegmentBodyJobRequest::DataList> CreateSegmentBodyJobRequest::getDataList()const
{
return dataList_;
}
void CreateSegmentBodyJobRequest::setDataList(const std::vector<DataList>& dataList)
{
dataList_ = dataList;
for(int dep1 = 0; dep1!= dataList.size(); dep1++) {
auto dataListObj = dataList.at(dep1);
std::string dataListObjStr = "DataList." + std::to_string(dep1 + 1);
setParameter(dataListObjStr + ".DataId", dataListObj.dataId);
setParameter(dataListObjStr + ".ImageUrl", dataListObj.imageUrl);
}
}
bool CreateSegmentBodyJobRequest::getAsync()const
{
return async_;
}
void CreateSegmentBodyJobRequest::setAsync(bool async)
{
async_ = async;
setBodyParameter("Async", async ? "true" : "false");
}
std::string CreateSegmentBodyJobRequest::getJobId()const
{
return jobId_;
}
void CreateSegmentBodyJobRequest::setJobId(const std::string& jobId)
{
jobId_ = jobId;
setBodyParameter("JobId", jobId);
}
int CreateSegmentBodyJobRequest::getTimeToLive()const
{
return timeToLive_;
}
void CreateSegmentBodyJobRequest::setTimeToLive(int timeToLive)
{
timeToLive_ = timeToLive;
setBodyParameter("TimeToLive", std::to_string(timeToLive));
}
| 28.088608 | 99 | 0.746282 | [
"vector",
"model"
] |
02cac6ece7ccedd36620f243bee0f3b01228422d | 978 | cpp | C++ | grooking_patterns_cpp/game_theory/divide_subtract.cpp | Amarnathpg123/grokking_coding_patterns | c615482ef2819d90cba832944943a6b5713d11f3 | [
"MIT"
] | 1 | 2021-09-19T16:41:58.000Z | 2021-09-19T16:41:58.000Z | grooking_patterns_cpp/game_theory/divide_subtract.cpp | Amarnathpg123/grokking_coding_patterns | c615482ef2819d90cba832944943a6b5713d11f3 | [
"MIT"
] | null | null | null | grooking_patterns_cpp/game_theory/divide_subtract.cpp | Amarnathpg123/grokking_coding_patterns | c615482ef2819d90cba832944943a6b5713d11f3 | [
"MIT"
] | null | null | null | //https://practice.geeksforgeeks.org/problems/divide-and-subtract-game2253/1/?category%5B%5D
#include <bits/stdc++.h>
using namespace std;
template <typename T>
void fastInput(T &x) {
bool neg = false;
register int c; x = 0; c = getchar();
if(c == '-') { neg = true; c = getchar(); }
while(c < 48 or c > 57) c = getchar();
for(; (c > 47 and c < 58); c = getchar()) x = (x<<1) + (x<<3) + (c&15); //x = x*2 + x*8 + c-48
if(neg) x *= -1;
}
bool whoWins(int const &n) {
if(n == 1) return 0;
vector<bool> dp(n+1, 0);
for(int i = 2; i < n; ++i) {
for(int j = 2; j < 6; ++j) {
if(dp[i/j] == 0) dp[i] = 1;
if(i-j >= 0 and dp[i-j] == 0) dp[i] = 1;
}
}
return dp[n];
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(nullptr); cout.tie(nullptr);
int t; fastInput(t);
while(t--) {
int n; fastInput(n);
whoWins(n)?printf("Jon"): printf("Arya");
}
return 0;
} | 25.736842 | 98 | 0.497955 | [
"vector"
] |
c49970161e11527ac4daeec4308153329f2b68a5 | 2,253 | cpp | C++ | ch11/flann/flann_surf_demo.cpp | icyplayer/OpenCV3Learning | c2d107b6b8895086f499c6be16c2e15521d36799 | [
"MIT"
] | null | null | null | ch11/flann/flann_surf_demo.cpp | icyplayer/OpenCV3Learning | c2d107b6b8895086f499c6be16c2e15521d36799 | [
"MIT"
] | null | null | null | ch11/flann/flann_surf_demo.cpp | icyplayer/OpenCV3Learning | c2d107b6b8895086f499c6be16c2e15521d36799 | [
"MIT"
] | null | null | null | /*
* flann_surf_demo.cpp
*
* Created on: 2017年3月21日
* Author: icyplayer
*/
// FIXME cannot run under Mac OS X 10.12, video related.
#include <opencv2/opencv.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/nonfree/features2d.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main_bug_flann_surf()
{
// 1. Load images and convert gray image
Mat trainImage = imread("image/2.jpg");
Mat trainImage_gray;
imshow("origin", trainImage);
cvtColor(trainImage, trainImage_gray, CV_BGR2GRAY);
// 2. Detect SURF keypoints, get train descriptors
vector<KeyPoint> train_keyPoint;
Mat trainDescriptor;
int minHessian = 80;
SurfFeatureDetector featureDetector(minHessian);
featureDetector.detect(trainImage_gray, train_keyPoint, trainDescriptor);
// 3. Create descriptor based on FLANN
FlannBasedMatcher matcher;
vector<Mat> train_desc_collection(1, trainDescriptor);
matcher.add(train_desc_collection);
matcher.train();
// 4. Create video object, define frame count
VideoCapture cap(0);
unsigned int frameCount = 0;
// Loop until <q> pressed
while(char(waitKey(1)) != 'q'){
// Param setting
int64 time0 = getTickCount();
Mat testImage, testImage_gray;
cap >>testImage;
if(testImage.empty()){
continue;
}
// Convert to gray
cvtColor(trainImage, trainImage_gray, CV_BGR2GRAY);
// Detect S keypoint, get test image's descriptor
vector<KeyPoint> test_keyPoint;
Mat testDescriptor;
featureDetector.detect(testImage_gray, test_keyPoint);
featureDetector.compute(testImage_gray, test_keyPoint, testDescriptor);
// Match train and query descriptors
vector<vector<DMatch> > matches;
matcher.knnMatch(testDescriptor, matches, 2);
// Lowe's algorithm
vector<DMatch> goodMatches;
for(unsigned int i = 0; i < matches.size(); ++i){
if(matches[i][0].distance < 0.6*matches[i][1].distance){
goodMatches.push_back(matches[i][0]);
}
}
Mat dstImage;
drawMatches(testImage, test_keyPoint, trainImage, train_keyPoint, goodMatches, dstImage);
imshow("matching result", dstImage);
// Print fps info
cout <<"Current frame rate:" <<getTickFrequency() / (getTickCount() - time0) <<endl;
}
return 0;
}
| 25.896552 | 91 | 0.731913 | [
"object",
"vector"
] |
c4b1b81b0c846c8d765f90becd0af6f7b4ace252 | 4,908 | cpp | C++ | source/Core/CastorUtils/Platform/Win32/LoggerConsole.cpp | DragonJoker/Castor3D | ee0b02eeda70cd235a224be306539850e32195f6 | [
"MIT"
] | 245 | 2015-10-29T14:31:45.000Z | 2022-03-31T13:04:45.000Z | source/Core/CastorUtils/Platform/Win32/LoggerConsole.cpp | DragonJoker/Castor3D | ee0b02eeda70cd235a224be306539850e32195f6 | [
"MIT"
] | 64 | 2016-03-11T19:45:05.000Z | 2022-03-31T23:58:33.000Z | source/Core/CastorUtils/Platform/Win32/LoggerConsole.cpp | DragonJoker/Castor3D | ee0b02eeda70cd235a224be306539850e32195f6 | [
"MIT"
] | 11 | 2018-05-24T09:07:43.000Z | 2022-03-21T21:05:20.000Z | #include "CastorUtils/Log/LoggerConsole.hpp"
#if defined( CU_PlatformWindows )
#include "CastorUtils/Miscellaneous/StringUtils.hpp"
#include <Windows.h>
#include <tchar.h>
#include <codecvt>
#include <iomanip>
#undef min
#undef max
#undef abs
#define CU_UseAnsiCode 0
namespace castor
{
void printCDBConsole( String const & toLog, bool newLine )
{
if ( ::IsDebuggerPresent() )
{
int length = MultiByteToWideChar( CP_UTF8, 0u, toLog.c_str(), -1, nullptr, 0u );
if ( length > 0 )
{
std::vector< wchar_t > buffer( size_t( length + 1 ), wchar_t{} );
MultiByteToWideChar( CP_UTF8, 0u, toLog.c_str(), -1, buffer.data(), length );
std::wstring converted{ buffer.begin(), buffer.end() };
::OutputDebugStringW( converted.c_str() );
}
if ( newLine )
{
::OutputDebugStringW( L"\n" );
}
}
}
class DebugConsole
: public ConsoleImpl
{
public:
DebugConsole( bool CU_UnusedParam( showConsole ) )
{
if ( ::AllocConsole() )
{
m_allocated = true;
doInitialiseConsole();
}
else
{
DWORD lastError = ::GetLastError();
if ( lastError == ERROR_ACCESS_DENIED )
{
doInitialiseConsole();
}
else
{
std::cerr << "Failed to create to a new console with error " << lastError << std::endl;
}
}
}
virtual ~DebugConsole()
{
if ( m_allocated )
{
::FreeConsole();
}
}
void beginLog( LogType logLevel )
{
#if CU_UseAnsiCode
switch ( logLevel )
{
case LogType::eTrace:
m_header = cuT( "[36m" );
break;
case LogType::eDebug:
m_header = cuT( "[1;36m" );
break;
case LogType::eInfo:
m_header = cuT( "[0m" );
break;
case LogType::eWarning:
m_header = cuT( "[33m" );
break;
case LogType::eError:
m_header = cuT( "[31m" );
break;
default:
break;
}
#else
WORD attributes{};
switch ( logLevel )
{
case LogType::eTrace:
attributes = FOREGROUND_BLUE | FOREGROUND_GREEN;
break;
case LogType::eDebug:
attributes = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
break;
case LogType::eWarning:
attributes = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
break;
case LogType::eError:
attributes = FOREGROUND_RED | FOREGROUND_INTENSITY;
break;
default:
attributes = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY;
break;
}
::SetConsoleTextAttribute( m_handle, attributes );
#endif
}
void print( String const & toLog, bool newLine )
{
printCDBConsole( toLog, newLine );
#if CU_UseAnsiCode
printf( "%s%s", m_header.c_str(), toLog.c_str() );
#else
printf( "%s", toLog.c_str() );
#endif
if ( newLine )
{
printf( "\n" );
}
}
private:
void doInitialiseConsole()
{
FILE * dump;
( void )freopen_s( &dump, "conout$", "w", stdout );
( void )freopen_s( &dump, "conout$", "w", stderr );
m_handle = ::GetStdHandle( STD_OUTPUT_HANDLE );
}
private:
bool m_allocated{ false };
HANDLE m_handle{ INVALID_HANDLE_VALUE };
};
class ReleaseConsole
: public ConsoleImpl
{
public:
explicit ReleaseConsole( bool showConsole )
{
if ( showConsole )
{
if ( ::AllocConsole() )
{
m_allocated = true;
doInitialiseConsole( INVALID_HANDLE_VALUE );
}
else
{
DWORD lastError = ::GetLastError();
if ( lastError == ERROR_ACCESS_DENIED )
{
doInitialiseConsole( ::GetStdHandle( STD_OUTPUT_HANDLE ) );
}
else
{
std::cerr << "Failed to create to a new console with error " << lastError << std::endl;
}
}
}
}
virtual ~ReleaseConsole()
{
if ( m_allocated )
{
::FreeConsole();
}
}
void beginLog( LogType CU_UnusedParam( logLevel ) )
{
}
void print( String const & toLog, bool newLine )
{
printCDBConsole( toLog, newLine );
printf( "%s", toLog.c_str() );
if ( newLine )
{
printf( "\n" );
}
}
private:
void doInitialiseConsole( HANDLE CU_UnusedParam( handle ) )
{
FILE * dump;
( void )freopen_s( &dump, "conout$", "w", stdout );
( void )freopen_s( &dump, "conout$", "w", stderr );
}
private:
bool m_allocated{ false };
};
//************************************************************************************************
ProgramConsole::ProgramConsole( bool showConsole )
{
#if defined( NDEBUG )
m_console = std::make_unique< ReleaseConsole >( showConsole );
#else
m_console = std::make_unique< DebugConsole >( showConsole );
#endif
}
ProgramConsole::~ProgramConsole()
{
}
void ProgramConsole::beginLog( LogType logLevel )
{
m_console->beginLog( logLevel );
}
void ProgramConsole::print( String const & toLog, bool newLine )
{
m_console->print( toLog, newLine );
}
//************************************************************************************************
}
#endif
| 19.247059 | 99 | 0.59617 | [
"vector"
] |
c4b29658e31c97c3e4e39ade620b5ed0fd8dcc1a | 6,767 | cpp | C++ | c_glib/arrow-glib/local-file-system.cpp | timkpaine/arrow | a96297e65e17e728e4321cdecc7ace146e1363fb | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | 9,734 | 2016-02-17T13:22:12.000Z | 2022-03-31T09:35:00.000Z | c_glib/arrow-glib/local-file-system.cpp | timkpaine/arrow | a96297e65e17e728e4321cdecc7ace146e1363fb | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | 11,470 | 2016-02-19T15:30:28.000Z | 2022-03-31T23:27:21.000Z | c_glib/arrow-glib/local-file-system.cpp | XpressAI/arrow | eafd885e06f6bbc1eb169ed64016f804c1810bec | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | 2,637 | 2016-02-17T10:56:29.000Z | 2022-03-31T08:20:13.000Z | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include <arrow-glib/file-system.hpp>
#include <arrow-glib/local-file-system.hpp>
G_BEGIN_DECLS
/**
* SECTION: local-file-system
* @section_id: local-file-system-classes
* @title: Local file system classes
* @include: arrow-glib/arrow-glib.h
*
* #GArrowLocalFileSystemOptions is a class for specifyiing options of
* an instance of #GArrowLocalFileSystem.
*
* #GArrowLocalFileSystem is a class for an implementation of a file system
* that accesses files on the local machine.
*/
typedef struct GArrowLocalFileSystemOptionsPrivate_ {
arrow::fs::LocalFileSystemOptions local_file_system_options;
} GArrowLocalFileSystemOptionsPrivate;
enum {
PROP_LOCAL_FILE_SYSTEM_OPTIONS_USE_MMAP = 1,
};
G_DEFINE_TYPE_WITH_PRIVATE(GArrowLocalFileSystemOptions,
garrow_local_file_system_options,
G_TYPE_OBJECT)
#define GARROW_LOCAL_FILE_SYSTEM_OPTIONS_GET_PRIVATE(obj) \
static_cast<GArrowLocalFileSystemOptionsPrivate *>( \
garrow_local_file_system_options_get_instance_private( \
GARROW_LOCAL_FILE_SYSTEM_OPTIONS(obj)))
static void
garrow_local_file_system_options_finalize(GObject *object)
{
auto priv = GARROW_LOCAL_FILE_SYSTEM_OPTIONS_GET_PRIVATE(object);
priv->local_file_system_options.~LocalFileSystemOptions();
G_OBJECT_CLASS(garrow_local_file_system_options_parent_class)->finalize(object);
}
static void
garrow_local_file_system_options_set_property(GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
auto priv = GARROW_LOCAL_FILE_SYSTEM_OPTIONS_GET_PRIVATE(object);
switch (prop_id) {
case PROP_LOCAL_FILE_SYSTEM_OPTIONS_USE_MMAP:
priv->local_file_system_options.use_mmap = g_value_get_boolean(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
}
static void
garrow_local_file_system_options_get_property(GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
auto priv = GARROW_LOCAL_FILE_SYSTEM_OPTIONS_GET_PRIVATE(object);
switch (prop_id) {
case PROP_LOCAL_FILE_SYSTEM_OPTIONS_USE_MMAP:
g_value_set_boolean(value, priv->local_file_system_options.use_mmap);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
}
static void
garrow_local_file_system_options_init(GArrowLocalFileSystemOptions *object)
{
auto priv = GARROW_LOCAL_FILE_SYSTEM_OPTIONS_GET_PRIVATE(object);
new(&priv->local_file_system_options) arrow::fs::LocalFileSystemOptions;
}
static void
garrow_local_file_system_options_class_init(GArrowLocalFileSystemOptionsClass *klass)
{
GParamSpec *spec;
auto gobject_class = G_OBJECT_CLASS(klass);
gobject_class->finalize = garrow_local_file_system_options_finalize;
gobject_class->set_property = garrow_local_file_system_options_set_property;
gobject_class->get_property = garrow_local_file_system_options_get_property;
auto local_file_system_options = arrow::fs::LocalFileSystemOptions::Defaults();
/**
* GArrowLocalFileSystemOptions:use-mmap:
*
* Whether open_input_stream and open_input_file return a mmap'ed file,
* or a regular one.
*
* Since: 0.17.0
*/
spec = g_param_spec_boolean("use-mmap",
"Use mmap",
"Whether to use mmap",
local_file_system_options.use_mmap,
static_cast<GParamFlags>(G_PARAM_READWRITE));
g_object_class_install_property(gobject_class,
PROP_LOCAL_FILE_SYSTEM_OPTIONS_USE_MMAP,
spec);
}
/**
* garrow_local_file_system_options_new:
*
* Returns: (transfer full): A newly created #GArrowLocalFileSystemOptions.
*
* Since: 0.17.0
*/
GArrowLocalFileSystemOptions *
garrow_local_file_system_options_new(void)
{
return GARROW_LOCAL_FILE_SYSTEM_OPTIONS(
g_object_new(GARROW_TYPE_LOCAL_FILE_SYSTEM_OPTIONS, NULL));
}
/* arrow::fs::LocalFileSystem */
G_DEFINE_TYPE(GArrowLocalFileSystem,
garrow_local_file_system,
GARROW_TYPE_FILE_SYSTEM)
static void
garrow_local_file_system_init(GArrowLocalFileSystem *file_system)
{
}
static void
garrow_local_file_system_class_init(GArrowLocalFileSystemClass *klass)
{
}
/**
* garrow_local_file_system_new:
* @options: (nullable): A #GArrowLocalFileSystemOptions.
*
* Returns: (transfer full): A newly created #GArrowLocalFileSystem.
*
* Since: 0.17.0
*/
GArrowLocalFileSystem *
garrow_local_file_system_new(GArrowLocalFileSystemOptions *options)
{
if (options) {
const auto &arrow_options =
garrow_local_file_system_options_get_raw(options);
auto arrow_local_file_system =
std::static_pointer_cast<arrow::fs::FileSystem>(
std::make_shared<arrow::fs::LocalFileSystem>(arrow_options));
return garrow_local_file_system_new_raw(&arrow_local_file_system);
} else {
auto arrow_local_file_system =
std::static_pointer_cast<arrow::fs::FileSystem>(
std::make_shared<arrow::fs::LocalFileSystem>());
return garrow_local_file_system_new_raw(&arrow_local_file_system);
}
}
G_END_DECLS
arrow::fs::LocalFileSystemOptions &
garrow_local_file_system_options_get_raw(GArrowLocalFileSystemOptions *options)
{
auto priv = GARROW_LOCAL_FILE_SYSTEM_OPTIONS_GET_PRIVATE(options);
return priv->local_file_system_options;
}
GArrowLocalFileSystem *
garrow_local_file_system_new_raw(std::shared_ptr<arrow::fs::FileSystem> *arrow_file_system)
{
return GARROW_LOCAL_FILE_SYSTEM(
g_object_new(GARROW_TYPE_LOCAL_FILE_SYSTEM,
"file-system", arrow_file_system,
NULL));
}
| 31.919811 | 91 | 0.723511 | [
"object"
] |
c4bca34aad9a48a3db9279f7aab0e3155578aa4c | 8,651 | hxx | C++ | code/rtkIncrementalFourDROOSTERConeBeamReconstructionFilter.hxx | ldqcarbon/RTK | 88df8ed953805aca3c5a73c22cb940164e7cc296 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | code/rtkIncrementalFourDROOSTERConeBeamReconstructionFilter.hxx | ldqcarbon/RTK | 88df8ed953805aca3c5a73c22cb940164e7cc296 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | code/rtkIncrementalFourDROOSTERConeBeamReconstructionFilter.hxx | ldqcarbon/RTK | 88df8ed953805aca3c5a73c22cb940164e7cc296 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | /*=========================================================================
*
* Copyright RTK Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef __rtkIncrementalFourDROOSTERConeBeamReconstructionFilter_hxx
#define __rtkIncrementalFourDROOSTERConeBeamReconstructionFilter_hxx
#include "rtkIncrementalFourDROOSTERConeBeamReconstructionFilter.h"
#include <algorithm>
namespace rtk
{
template<class VolumeSeriesType, class ProjectionStackType>
IncrementalFourDROOSTERConeBeamReconstructionFilter<VolumeSeriesType, ProjectionStackType>
::IncrementalFourDROOSTERConeBeamReconstructionFilter()
{
// Set the default values of member parameters
m_NumberOfProjectionsPerSubset=0;
m_NumberOfSubsets=1;
m_Kzero = 1;
}
template<class VolumeSeriesType, class ProjectionStackType>
void
IncrementalFourDROOSTERConeBeamReconstructionFilter<VolumeSeriesType, ProjectionStackType>
::GenerateOutputInformation()
{
// Call the superclass method to prepare all filters of the pipeline with
// the correct runtime parameters, but without connecting them to each other
Superclass::GenerateOutputInformation();
unsigned int Dimension = ProjectionStackType::ImageDimension;
// Divide the set of projections into subsets, each one containing nprojpersubset projections (except maybe the last subset)
// For each subset, store the selectedProjs vector, and create one SubSelectFromListImageFilter and one PhasesToInterpolationWeights filter
unsigned int nProjs = this->GetInputProjectionStack()->GetLargestPossibleRegion().GetSize(Dimension - 1);
// If the number of projections per subset has not been set, use the whole projection stack every time
if (m_NumberOfProjectionsPerSubset == 0)
{
m_NumberOfSubsets = 1;
m_NumberOfProjectionsPerSubset = nProjs;
}
// Otherwise compute the number of subsets
else
m_NumberOfSubsets = ceil((float)nProjs / (float) m_NumberOfProjectionsPerSubset);
// Create a vector with the projection indices and shuffle it,
// in order to build the subsets with randomly chosen projections
std::vector< unsigned int > projOrder(nProjs);
for(unsigned int i = 0; i < nProjs; i++)
projOrder[i] = i;
std::random_shuffle( projOrder.begin(), projOrder.end() );
for (unsigned int subset = 0; subset < m_NumberOfSubsets; subset++)
{
// Create a vector of booleans, indicating whether a projection is selected or not
std::vector< bool > selectedProjs(nProjs);
std::fill(selectedProjs.begin(), selectedProjs.end(), false);
for(unsigned int proj = subset * m_NumberOfProjectionsPerSubset; (proj < nProjs) && (proj < (subset + 1) * m_NumberOfProjectionsPerSubset); proj++)
selectedProjs[projOrder[proj]] = true;
// Store this vector
m_SelectedProjsVector.push_back(selectedProjs);
// Use the SubSelectFromListImageFilter to extract the substack of projections and the subgeometry
m_SubSelectFilters.push_back(SubSelectType::New());
m_SubSelectFilters[subset]->SetSelectedProjections( m_SelectedProjsVector[subset] );
m_SubSelectFilters[subset]->SetInputGeometry( this->m_Geometry );
m_SubSelectFilters[subset]->SetInputProjectionStack( this->GetInputProjectionStack() );
m_SubSelectFilters[subset]->Update();
// Read the phases file, and extract the interpolation weights for this subset
m_PhasesFilters.push_back(rtk::PhasesToInterpolationWeights::New());
m_PhasesFilters[subset]->SetFileName(m_PhasesFileName);
m_PhasesFilters[subset]->SetNumberOfReconstructedFrames(this->GetInputVolumeSeries()->GetLargestPossibleRegion().GetSize(Dimension));
m_PhasesFilters[subset]->SetSelectedProjections( m_SelectedProjsVector[subset] );
m_PhasesFilters[subset]->Update();
}
// Set the conjugate gradient filter to reconstruct from the first subset
this->m_FourDCGFilter->SetInputProjectionStack(m_SubSelectFilters[0]->GetOutput());
this->m_FourDCGFilter->SetInputVolumeSeries(this->GetInputVolumeSeries());
this->m_FourDCGFilter->SetNumberOfIterations(this->m_CG_iterations);
this->m_FourDCGFilter->SetGeometry(m_SubSelectFilters[0]->GetOutputGeometry());
this->m_FourDCGFilter->SetWeights(m_PhasesFilters[0]->GetOutput());
this->m_FourDCGFilter->SetCudaConjugateGradient(this->GetCudaConjugateGradient());
// Compute output information
this->m_FourDCGFilter->UpdateOutputInformation();
this->GetOutput()->CopyInformation( this->m_FourDCGFilter->GetOutput() );
}
template<class VolumeSeriesType, class ProjectionStackType>
void
IncrementalFourDROOSTERConeBeamReconstructionFilter<VolumeSeriesType, ProjectionStackType>
::GenerateData()
{
typename VolumeSeriesType::Pointer pimg;
// Variables to loop through the data subterms, the regularizations and the constraints
unsigned int constraintIndex = 0;
// Real work
for (int ml_iter=0; ml_iter < this->m_MainLoop_iterations; ml_iter++)
{
for (unsigned int costTerm = 0; costTerm < m_NumberOfSubsets + 2; costTerm++)
{
float alpha_k = m_Kzero / ((ml_iter * m_NumberOfSubsets + 2) + m_Kzero);
if (costTerm < m_NumberOfSubsets)
{
// If this is the first subset during the first main loop iteration,
// pimg does not contain anything yet. Use the filter's input instead
if ((costTerm == 0) && (ml_iter == 0))
this->m_FourDCGFilter->SetInputVolumeSeries( this->GetInputVolumeSeries() );
else
this->m_FourDCGFilter->SetInputVolumeSeries( pimg );
this->m_FourDCGFilter->SetInputProjectionStack( m_SubSelectFilters[costTerm]->GetOutput() );
this->m_FourDCGFilter->SetGeometry( m_SubSelectFilters[costTerm]->GetOutputGeometry() );
this->m_FourDCGFilter->SetWeights(m_PhasesFilters[costTerm]->GetOutput());
TRY_AND_EXIT_ON_ITK_EXCEPTION( this->m_FourDCGFilter->Update() );
pimg = this->m_FourDCGFilter->GetOutput();
pimg->DisconnectPipeline();
}
if (costTerm == m_NumberOfSubsets)
{
// Spatial TV
this->m_TVDenoisingSpace->SetGamma(this->m_GammaTVSpace * alpha_k);
this->m_TVDenoisingSpace->SetInput( pimg );
TRY_AND_EXIT_ON_ITK_EXCEPTION( this->m_TVDenoisingSpace->Update() );
pimg = this->m_TVDenoisingSpace->GetOutput();
pimg->DisconnectPipeline();
}
if (costTerm == m_NumberOfSubsets + 1)
{
if (this->m_PerformWarping)
{
// Warp all frames to a single phase
this->m_Warp->SetInput( pimg );
TRY_AND_EXIT_ON_ITK_EXCEPTION( this->m_Warp->Update(); );
pimg = this->m_Warp->GetOutput();
pimg->DisconnectPipeline();
}
// Temporal TV
this->m_TVDenoisingTime->SetGamma(this->m_GammaTVTime * alpha_k);
this->m_TVDenoisingTime->SetInput( pimg );
TRY_AND_EXIT_ON_ITK_EXCEPTION( this->m_TVDenoisingTime->Update() );
pimg = this->m_TVDenoisingTime->GetOutput();
pimg->DisconnectPipeline();
if (this->m_PerformWarping)
{
// Warp all frames back
this->m_Unwarp->SetInput( pimg );
TRY_AND_EXIT_ON_ITK_EXCEPTION( this->m_Unwarp->Update(); );
pimg = this->m_Unwarp->GetOutput();
pimg->DisconnectPipeline();
}
}
// Apply one constraint
if (constraintIndex%2)
{
this->m_AverageOutOfROIFilter->SetInput(pimg);
TRY_AND_EXIT_ON_ITK_EXCEPTION( this->m_AverageOutOfROIFilter->Update() );
pimg = this->m_AverageOutOfROIFilter->GetOutput();
pimg->DisconnectPipeline();
}
else
{
this->m_PositivityFilter->SetInput(pimg);
TRY_AND_EXIT_ON_ITK_EXCEPTION( this->m_PositivityFilter->Update() );
pimg = this->m_PositivityFilter->GetOutput();
pimg->DisconnectPipeline();
}
// Increment the constraint index
constraintIndex++;
}
}
this->GraftOutput( pimg );
}
} // end namespace rtk
#endif // __rtkIncrementalFourDROOSTERConeBeamReconstructionFilter_hxx
| 41.995146 | 151 | 0.709629 | [
"vector"
] |
c4c23c5079f95e5320d1e7174191fba75b3efc59 | 4,149 | cpp | C++ | src/compositor/scenegraph/scene.cpp | Quora-Users/motorcar | e1cb943d2874a4716556c314190a48294e2bf53a | [
"BSD-2-Clause"
] | 216 | 2015-01-20T17:14:01.000Z | 2022-03-05T16:14:25.000Z | src/compositor/scenegraph/scene.cpp | Quora-Users/motorcar | e1cb943d2874a4716556c314190a48294e2bf53a | [
"BSD-2-Clause"
] | 12 | 2015-07-09T06:46:09.000Z | 2017-04-13T05:41:08.000Z | src/compositor/scenegraph/scene.cpp | Quora-Users/motorcar | e1cb943d2874a4716556c314190a48294e2bf53a | [
"BSD-2-Clause"
] | 29 | 2015-03-14T03:19:52.000Z | 2021-01-29T13:43:51.000Z | /****************************************************************************
**This file is part of the Motorcar 3D windowing framework
**
**
**Copyright (C) 2014 Forrest Reiling
**
**
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
**
****************************************************************************/
#include <scenegraph/scene.h>
#include <windowmanager.h>
using namespace motorcar;
Scene::Scene()
:PhysicalNode()
,m_windowManager(NULL)
,m_trash(NULL)
,m_currentTimestampMillis(0)
,m_lastTimestepMillis(0)
,m_activeDisplay(NULL)
{
}
Scene::~Scene()
{
delete m_windowManager;
}
//void Scene::draw(long deltaMillis)
//{
// for(Display *display : displays()){
// display->prepareForDraw();
// }
// this->traverseSceneGraph(this, deltaMillis);
// for(Display *display : displays()){
// display->finishDraw();
// }
//}
Scene *Scene::scene()
{
return this;
}
void Scene::prepareForFrame(long timeStampMillis)
{
this->setCurrentTimestampMillis(timeStampMillis);
this->mapOntoSubTree(&SceneGraphNode::handleFrameBegin, this);
for(Display *display : displays()){
for(ViewPoint *viewpoint : display->viewpoints()){
viewpoint->updateViewMatrix();
}
}
}
void Scene::drawFrame()
{
for(Display * display : this->displays()){
this->setActiveDisplay(display);
display->prepareForDraw();
this->mapOntoSubTree(&SceneGraphNode::handleFrameDraw, this);
display->finishDraw();
}
}
void Scene::finishFrame()
{
this->mapOntoSubTree(&SceneGraphNode::handleFrameEnd, this);
int error = glGetError();
if(error != GL_NO_ERROR){
std::cout << "OpenGL Error from frame: " << error <<std::endl;
}
}
WindowManager *Scene::windowManager() const
{
return m_windowManager;
}
void Scene::setWindowManager(WindowManager *windowManager)
{
m_windowManager = windowManager;
}
Compositor *Scene::compositor() const
{
return m_compositor;
}
void Scene::setCompositor(Compositor *compositor)
{
m_compositor = compositor;
}
void Scene::addDisplay(Display *display)
{
m_displays.push_back(display);
}
std::vector<Display *> Scene::displays() const
{
return m_displays;
}
long Scene::currentTimestampMillis() const
{
return m_currentTimestampMillis;
}
void Scene::setCurrentTimestampMillis(long currentTimestampMillis)
{
m_lastTimestepMillis = m_currentTimestampMillis;
m_currentTimestampMillis = currentTimestampMillis;
}
long Scene::latestTimestampChange()
{
return m_currentTimestampMillis - m_lastTimestepMillis;
}
Display *Scene::activeDisplay() const
{
return m_activeDisplay;
}
void Scene::setActiveDisplay(Display *activeDisplay)
{
m_activeDisplay = activeDisplay;
}
| 23.573864 | 77 | 0.684984 | [
"vector",
"3d"
] |
c4c49972245e8b198d4a7247ddef8fa449c55485 | 5,993 | cpp | C++ | examples.cpp | Rawk/mysql-cpp | 12e4a46b75c0ab2d2fea6ea80a94bf0471b468c5 | [
"MIT"
] | 80 | 2015-04-21T09:28:29.000Z | 2022-03-29T13:10:00.000Z | examples.cpp | Rawk/mysql-cpp | 12e4a46b75c0ab2d2fea6ea80a94bf0471b468c5 | [
"MIT"
] | 2 | 2018-10-02T07:51:34.000Z | 2019-09-06T13:13:48.000Z | examples.cpp | Rawk/mysql-cpp | 12e4a46b75c0ab2d2fea6ea80a94bf0471b468c5 | [
"MIT"
] | 42 | 2015-07-23T12:38:24.000Z | 2022-01-17T03:56:31.000Z | #include "MySql.hpp"
#include "MySqlException.hpp"
#include <cassert>
#include <iostream>
#include <memory>
#include <string>
#include <tuple>
#include <vector>
using std::basic_ostream;
using std::cin;
using std::cout;
using std::endl;
using std::get;
using std::ostream;
using std::string;
using std::tuple;
using std::unique_ptr;
using std::vector;
template <std::size_t> struct int_ {}; // compile-time counter
template <typename Char, typename Traits, typename Tuple, std::size_t I>
void printTuple(basic_ostream<Char, Traits>& out, Tuple const& t, int_<I>);
template <typename Char, typename Traits, typename Tuple>
void printTuple(basic_ostream<Char, Traits>& out, Tuple const& t, int_<0>);
template <typename Tuple>
void printTupleVector(const vector<Tuple>& v);
template <typename Char, typename Traits, typename... Args>
ostream& operator<<(basic_ostream<Char, Traits>& out, tuple<Args...> const& t);
template <typename T>
ostream& operator<<(ostream& out, const unique_ptr<T>& ptr);
int main(int argc, char* argv[]) {
string password;
if (argc == 1) {
cout << "Enter MySQL root password: " << endl;
cin >> password;
} else {
password = argv[1];
}
MySql conn("127.0.0.1", "root", password.c_str(), nullptr);
// Initialize a new test database
conn.runCommand("DROP DATABASE IF EXISTS test_mysql_cpp");
conn.runCommand("CREATE DATABASE test_mysql_cpp");
conn.runCommand("USE test_mysql_cpp");
conn.runCommand("DROP TABLE IF EXISTS user");
conn.runCommand(
"CREATE TABLE user ("
"id INT NOT NULL AUTO_INCREMENT,"
"PRIMARY KEY(id),"
"email VARCHAR(64) NOT NULL,"
"password CHAR(64) NOT NULL,"
"age INT)");
// ************
// Easy inserts
// ************
int ages[] = {27, 21, 26};
string emails[] = {
"bskari@yelp.com",
"brandon.skari@gmail.com",
"brandon@skari.org"};
string passwords[] = {
"peace",
"love",
"griffin"};
conn.runCommand(
"INSERT INTO user (email, password, age)"
" VALUES (?, ?, ?), (?, ?, ?), (?, ?, ?)",
emails[0], passwords[0], ages[0],
emails[1], passwords[1], ages[1],
emails[2], passwords[2], ages[2]);
typedef tuple<int, string, string, int> userTuple;
vector<userTuple> users;
// *****************************************
// All commands use safe prepared statements
// *****************************************
const string naughtyUser("brandon@skari.org'; DROP TABLE users; -- ");
conn.runQuery(&users, "SELECT * FROM user WHERE email = ?", naughtyUser);
assert(0 == users.size());
const char naughtyUser2[] = "something' OR '1' = 1' -- ";
const char* charPtr = naughtyUser2;
conn.runQuery(&users, "SELECT * FROM user WHERE email = ?", charPtr);
assert(0 == users.size());
// ***************************
// Automatically typed selects
// ***************************
conn.runQuery(&users, "SELECT * FROM user");
printTupleVector(users);
users.clear();
// ************************
// Dealing with NULL values
// ************************
conn.runCommand(
"INSERT INTO user (email, password, age) VALUES (?, ?, NULL)",
emails[0],
passwords[0]);
try {
// Trying to insert NULLs into a normal tuple will throw
conn.runQuery(&users, "SELECT * FROM user");
} catch (const MySqlException& e) {
cout << e.what() << endl;
}
// But, we can select into tuples with unique_ptr
typedef tuple<
unique_ptr<int>,
unique_ptr<string>,
unique_ptr<string>,
unique_ptr<int>
> autoPtrUserTuple;
vector<autoPtrUserTuple> autoPtrUsers;
conn.runQuery(&autoPtrUsers, "SELECT * FROM user");
printTupleVector(autoPtrUsers);
// *********************************************
// Raw pointers are gross, so this won't compile
// *********************************************
/*
vector<tuple<int*>> rawPointers;
conn.runQuery(&rawPointers, "SELECT age FROM user");
*/
// **************************************
// Look at all these type-based failures!
// **************************************
try {
// Wrong number of fields
vector<tuple<int>> selectAges;
conn.runQuery(&selectAges, "SELECT * FROM user");
} catch (const MySqlException& e) {
cout << e.what() << endl;
}
exit(EXIT_SUCCESS);
}
template<typename Char, typename Traits, typename Tuple, size_t I>
void printTuple(basic_ostream<Char, Traits>& out, Tuple const& t, int_<I>) {
printTuple(out, t, int_<I - 1>());
out << ", " << get<I>(t);
}
template<typename Char, typename Traits, typename Tuple>
void printTuple(basic_ostream<Char, Traits>& out, Tuple const& t, int_<0>) {
out << get<0>(t);
}
template <typename Tuple>
void printTupleVector(const vector<Tuple>& v) {
#if __GNUC__ >= 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
for (const auto& item : v)
{
cout << item << endl;
}
#elif __GNUC__ >= 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
auto end = v.cend();
for (auto item(v.cbegin()); item != end; ++item) {
cout << *item<< endl;
}
#else
vector<Tuple>::const_iterator end(users.end());
for (
vector<Tuple>::const_iterator item(v.begin());
item != end;
++item
) {
cout << *item << endl;
}
#endif
}
template<typename Char, typename Traits, typename... Args>
ostream& operator<<(
basic_ostream<Char, Traits>& out,
tuple<Args...> const& t
) {
out << "(";
printTuple(out, t, int_<sizeof...(Args) - 1>());
out << ")";
return out;
}
template <typename T>
ostream& operator<<(ostream& out, const unique_ptr<T>& ptr) {
if (nullptr != ptr.get()) {
out << *ptr;
} else {
out << "NULL";
}
return out;
}
| 28.674641 | 79 | 0.559319 | [
"vector"
] |
c4c71d4609fda8cdd516b599518e6aa367f9fd94 | 7,040 | cpp | C++ | multidropdown.cpp | buldzzxx/Aurora | 5a6d27646f94e2858b84f3c34c3612edc9722f95 | [
"MIT"
] | 1 | 2021-12-14T18:34:05.000Z | 2021-12-14T18:34:05.000Z | multidropdown.cpp | buldzzxx/Aurora | 5a6d27646f94e2858b84f3c34c3612edc9722f95 | [
"MIT"
] | null | null | null | multidropdown.cpp | buldzzxx/Aurora | 5a6d27646f94e2858b84f3c34c3612edc9722f95 | [
"MIT"
] | 2 | 2021-12-14T04:27:32.000Z | 2022-03-13T22:00:47.000Z | #include "includes.h"
void MultiDropdown::arrow1(Point p) {
render::rect_filled(p.x + m_w - 11, p.y + m_offset + 9 + 2, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(p.x + m_w - 10, p.y + m_offset + 9 + 2, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(p.x + m_w - 9, p.y + m_offset + 9 + 2, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(p.x + m_w - 8, p.y + m_offset + 9 + 2, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(p.x + m_w - 7, p.y + m_offset + 9 + 2, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(p.x + m_w - 10, p.y + m_offset + 9 + 1, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(p.x + m_w - 9, p.y + m_offset + 9 + 1, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(p.x + m_w - 8, p.y + m_offset + 9 + 1, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(p.x + m_w - 9, p.y + m_offset + 9, 1, 1, { 152, 152, 152, m_parent->m_alpha });
}
void MultiDropdown::arrow2(Point l) {
render::rect_filled(l.x + m_w - 11, l.y + m_offset + 9, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(l.x + m_w - 10, l.y + m_offset + 9, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(l.x + m_w - 9, l.y + m_offset + 9, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(l.x + m_w - 8, l.y + m_offset + 9, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(l.x + m_w - 7, l.y + m_offset + 9, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(l.x + m_w - 10, l.y + m_offset + 9 + 1, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(l.x + m_w - 9, l.y + m_offset + 9 + 1, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(l.x + m_w - 8, l.y + m_offset + 9 + 1, 1, 1, { 152, 152, 152, m_parent->m_alpha });
render::rect_filled(l.x + m_w - 9, l.y + m_offset + 9 + 2, 1, 1, { 152, 152, 152, m_parent->m_alpha });
}
void MultiDropdown::draw() {
Rect area{ m_parent->GetElementsRect() };
Point p{ area.x + m_pos.x, area.y + m_pos.y };
// get gui color.
Color color = g_gui.m_color;
color.a() = m_parent->m_alpha;
// draw label.
if (m_use_label)
render::menu_shade.string(p.x + LABEL_OFFSET, p.y - 2, { 205, 205, 205, m_parent->m_alpha }, m_label);
// draw border.
render::rect(p.x + DROPDOWN_X_OFFSET, p.y + m_offset, m_w - DROPDOWN_X_OFFSET, DROPDOWN_BOX_HEIGHT, { 0, 0, 0, m_parent->m_alpha });
// draw inside.
render::rect_filled(p.x + DROPDOWN_X_OFFSET + 1, p.y + m_offset + 1, m_w - DROPDOWN_X_OFFSET - 2, DROPDOWN_BOX_HEIGHT - 2, { 41, 41, 41, m_parent->m_alpha });
// arrow.
m_open ? arrow1(p) : arrow2(p);
// does this dropdown have any items?
if (!m_items.empty()) {
// is this dropdown open?
if (m_open) {
// draw items outline.
render::rect(p.x + DROPDOWN_X_OFFSET, p.y + m_offset + DROPDOWN_BOX_HEIGHT + DROPDOWN_SEPARATOR, m_w - DROPDOWN_X_OFFSET, m_anim_height + 1, { 0, 0, 0, m_parent->m_alpha });
// draw items inside.
render::rect_filled(p.x + DROPDOWN_X_OFFSET + 1, p.y + m_offset + DROPDOWN_BOX_HEIGHT + DROPDOWN_SEPARATOR + 1, m_w - DROPDOWN_X_OFFSET - 2, m_anim_height - 1, { 41, 41, 41, m_parent->m_alpha });
// iterate items.
for (size_t i{}; i < m_items.size(); ++i) {
// get offset to current item.
int item_offset = (i * DROPDOWN_ITEM_HEIGHT);
// has this item been animated yet?
if (m_anim_height > item_offset) {
// check.
bool active = std::find(m_active_items.begin(), m_active_items.end(), i) != m_active_items.end();
// yet again, it won't use list init inside the ternary conditional.
render::menu.string(p.x + DROPDOWN_X_OFFSET + DROPDOWN_ITEM_X_OFFSET, p.y + m_offset + DROPDOWN_BOX_HEIGHT + DROPDOWN_ITEM_Y_OFFSET + item_offset,
active ? color : Color{ 152, 152, 152, m_parent->m_alpha },
m_items[i]);
}
}
}
// no items.
if (!m_active_items.size())
render::menu.string(p.x + DROPDOWN_X_OFFSET + DROPDOWN_ITEM_X_OFFSET,
p.y + m_offset + 4, { 152, 152, 152, m_parent->m_alpha }, XOR("none"));
// one item.
else if (m_active_items.size() == 1)
render::menu.string(p.x + DROPDOWN_X_OFFSET + DROPDOWN_ITEM_X_OFFSET,
p.y + m_offset + 4, { 152, 152, 152, m_parent->m_alpha }, m_items[m_active_items.front()]);
// more then one item.
else {
std::stringstream tmp, ss;
auto items = GetActiveItems();
for (size_t i{}; i < items.size(); ++i) {
std::string item = items[i];
// first item should not have a comma infront.
if (i >= 1)
tmp << XOR(", ");
tmp << item;
// does it still fit in?
if (render::menu.size(tmp.str() + XOR("...")).m_width >= (m_w - DROPDOWN_X_OFFSET - DROPDOWN_ITEM_X_OFFSET - 10)) {
ss << XOR("...");
break;
}
if (i >= 1)
ss << XOR(", ");
ss << item;
}
render::menu.string(p.x + DROPDOWN_X_OFFSET + DROPDOWN_ITEM_X_OFFSET, p.y + m_offset + 4, { 152, 152, 152, m_parent->m_alpha }, ss.str());
}
}
}
void MultiDropdown::think() {
// fucker can be opened.
if (!m_items.empty()) {
int total_size = DROPDOWN_ITEM_HEIGHT * m_items.size();
// we need to travel 'total_size' in 300 ms.
float frequency = total_size / 0.3f;
// the increment / decrement per frame.
float step = frequency * g_csgo.m_globals->m_frametime;
// if open -> increment
// if closed -> decrement
m_open ? m_anim_height += step : m_anim_height -= step;
// clamp the size.
math::clamp< float >(m_anim_height, 0, total_size);
// open
if (m_open) {
// clicky height.
m_h = m_offset + DROPDOWN_BOX_HEIGHT + DROPDOWN_SEPARATOR + total_size;
// another element is in focus.
if (m_parent->m_active_element != this)
m_open = false;
}
// closed.
else
m_h = m_offset + DROPDOWN_BOX_HEIGHT;
}
// no items, no open.
else
m_h = m_offset + DROPDOWN_BOX_HEIGHT;
}
void MultiDropdown::click() {
Rect area{ m_parent->GetElementsRect() };
Point p{ area.x + m_pos.x, area.y + m_pos.y };
// bar.
Rect bar{ p.x + DROPDOWN_X_OFFSET, p.y + m_offset, m_w - DROPDOWN_X_OFFSET, DROPDOWN_BOX_HEIGHT };
// toggle if bar pressed.
if (g_input.IsCursorInRect(bar))
m_open = !m_open;
// check item clicks.
if (m_open) {
if (!g_input.IsCursorInRect(bar)) {
// iterate items.
for (size_t i{}; i < m_items.size(); ++i) {
Rect item{ p.x + DROPDOWN_X_OFFSET, p.y + m_offset + DROPDOWN_BOX_HEIGHT + DROPDOWN_SEPARATOR + (i * DROPDOWN_ITEM_HEIGHT), m_w - DROPDOWN_X_OFFSET, DROPDOWN_ITEM_HEIGHT };
// click was in context of current item.
if (g_input.IsCursorInRect(item)) {
bool active = std::find(m_active_items.begin(), m_active_items.end(), i) != m_active_items.end();
if (active) {
m_active_items.erase(std::remove(m_active_items.begin(), m_active_items.end(), i), m_active_items.end());
if (m_callback)
m_callback();
}
else {
m_active_items.push_back(i);
if (m_callback)
m_callback();
}
}
}
}
}
} | 34.851485 | 198 | 0.625994 | [
"render"
] |
c4cd494e68261b17c989f7bf2369383307e7fffa | 8,133 | cpp | C++ | src/cpp/libwmi.cpp | warriordog/jwmi | 57a24992dd2ba4237e962ef7b3e2d3aa9931d45b | [
"MIT"
] | 4 | 2019-11-06T01:45:21.000Z | 2021-07-06T14:36:41.000Z | src/cpp/libwmi.cpp | warriordog/jwmi | 57a24992dd2ba4237e962ef7b3e2d3aa9931d45b | [
"MIT"
] | null | null | null | src/cpp/libwmi.cpp | warriordog/jwmi | 57a24992dd2ba4237e962ef7b3e2d3aa9931d45b | [
"MIT"
] | 3 | 2020-01-21T06:17:20.000Z | 2020-09-23T08:44:54.000Z | #include "libwmi.h"
#include <iostream>
#pragma comment(lib, "wbemuuid.lib")
using namespace std;
namespace libwmi {
HRESULT openCOM() {
// open COM
HRESULT hr = CoInitializeEx(0, COINIT_MULTITHREADED);
if (FAILED(hr)) {
#ifdef LIBWMI_DEBUG
cout << "Failed to initialize COM library. Error code = 0x" << hex << hr << endl;
#endif
return hr;
}
// S_FALSE is returned if COM is already initialized. Setting security again will fail.
if (hr != S_FALSE) {
// setup security
hr = CoInitializeSecurity(
NULL, // Security descriptor
-1, // COM negotiates authentication service
NULL, // Authentication services
NULL, // Reserved
RPC_C_AUTHN_LEVEL_DEFAULT, // Default authentication level for proxies
RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation level for proxies
NULL, // Authentication info
EOAC_NONE, // Additional capabilities of the client or server
NULL // Reserved
);
// RPC_E_TOO_LATE is returned if the process already set security somewhere else.
if (FAILED(hr) && hr != RPC_E_TOO_LATE) {
#ifdef LIBWMI_DEBUG
cout << "Failed to initialize security. Error code = 0x" << hex << hr << endl;
#endif
CoUninitialize();
return hr;
}
}
return S_OK;
}
HRESULT createLocator(IWbemLocator** locator) {
if (locator == nullptr) {
#ifdef LIBWMI_DEBUG
cout << "locator is null" << endl;
#endif
return E_INVALIDARG;
}
// connect to WMI
HRESULT hr = CoCreateInstance(CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID *) locator);
if (FAILED(hr)) {
#ifdef LIBWMI_DEBUG
cout << "Failed to create IWbemLocator object. Error code = 0x" << hex << hr << endl;
#endif
return hr;
}
return S_OK;
}
HRESULT setSecurity(IWbemServices* locator) {
if (locator == nullptr) {
#ifdef LIBWMI_DEBUG
cout << "services is null" << endl;
#endif
return E_INVALIDARG;
}
// Set blanket security
HRESULT hr = CoSetProxyBlanket(
locator, // Indicates the proxy to set
RPC_C_AUTHN_WINNT, // RPC_C_AUTHN_xxx
RPC_C_AUTHZ_NONE, // RPC_C_AUTHZ_xxx
NULL, // Server principal name
RPC_C_AUTHN_LEVEL_CALL, // RPC_C_AUTHN_LEVEL_xxx
RPC_C_IMP_LEVEL_IMPERSONATE, // RPC_C_IMP_LEVEL_xxx
NULL, // client identity
EOAC_NONE // proxy capabilities
);
if (FAILED(hr)) {
#ifdef LIBWMI_DEBUG
cout << "Could not set proxy blanket. Error code = 0x" << hex << hr << endl;
#endif
return hr;
}
return S_OK;
}
HRESULT closeCOM() {
CoUninitialize();
return S_OK;
}
HRESULT IWbemLocator_ConnectServer(
IWbemLocator* locator,
const BSTR ns,
IWbemServices** services
) {
if (locator == nullptr || ns == nullptr || services == nullptr) {
#ifdef LIBWMI_DEBUG
cout << "Unexpected null argument" << endl;
#endif
return E_INVALIDARG;
}
// Connect to namespace
HRESULT hr = locator->ConnectServer(
ns, //namespace
NULL, // User name
NULL, // User password
NULL, // Locale
0, // Security flags
NULL, // Authority
nullptr, // Context object
services // IWbemServices proxy
);
if (FAILED(hr)) {
#ifdef LIBWMI_DEBUG
cout << "Could not connect to namespace. Error code = 0x" << hex << hr << endl;
#endif
return hr;
}
return S_OK;
}
HRESULT IWbemServices_ExecQuery(
IWbemServices* services,
const BSTR query,
IEnumWbemClassObject **clsObjEnum
) {
if (services == nullptr || query == nullptr || clsObjEnum == nullptr) {
#ifdef LIBWMI_DEBUG
cout << "Unexpected null argument" << endl;
#endif
return E_INVALIDARG;
}
HRESULT hr = services->ExecQuery(
bstr_t("WQL"),
query,
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
NULL,
clsObjEnum
);
if (FAILED(hr)) {
#ifdef LIBWMI_DEBUG
cout << "Query for failed. Error code = 0x" << hex << hr << endl;
#endif
return hr;
}
return S_OK;
}
HRESULT IEnumWbemClassObject_Next(
IEnumWbemClassObject* clsObjEnum,
IWbemClassObject **clsObj,
ULONG *count
) {
if (clsObjEnum == nullptr || clsObj == nullptr || count == nullptr) {
#ifdef LIBWMI_DEBUG
cout << "Unexpected null argument" << endl;
#endif
return E_INVALIDARG;
}
// read next result
HRESULT hr = clsObjEnum->Next(WBEM_INFINITE, 1, clsObj, count);
// end of enumeration
if (hr == WBEM_S_FALSE) {
// if we didn't return anything, then return null
if (*count == 0) {
*clsObj = nullptr;
}
}
return hr;
}
HRESULT IUnknown_Release(
IUnknown* obj
) {
if (obj == nullptr) {
#ifdef LIBWMI_DEBUG
cout << "obj is null" << endl;
#endif
return E_INVALIDARG;
}
obj->Release();
return S_OK;
}
HRESULT IWbemClassObject_Release(
IWbemClassObject* clsObj
) {
if (clsObj == nullptr) {
#ifdef LIBWMI_DEBUG
cout << "clsObj is null" << endl;
#endif
return E_INVALIDARG;
}
clsObj->Release();
return S_OK;
}
HRESULT IWbemClassObject_Get(
IWbemClassObject* clsObj,
LPCWSTR name,
VARIANT *value
) {
if (clsObj == nullptr || name == nullptr || value == nullptr) {
#ifdef LIBWMI_DEBUG
cout << "Unexpected null argument" << endl;
#endif
return E_INVALIDARG;
}
// Get the value of the Name property
HRESULT hr = clsObj->Get(name, 0, value, 0, 0);
if (FAILED(hr)) {
#ifdef LIBWMI_DEBUG
cout << "Getting query result failed. Error code = 0x" << hex << hr << endl;
#endif
return hr;
}
return S_OK;
}
HRESULT ClearVariant(
VARIANT* variant
) {
if (variant == nullptr) {
#ifdef LIBWMI_DEBUG
cout << "Variant is null" << endl;
#endif
return E_INVALIDARG;
}
return VariantClear(variant);
}
}
| 30.923954 | 121 | 0.456043 | [
"object"
] |
c4d43d9a57dcd146d3c7b8ed45c429e76fe26d70 | 8,066 | cpp | C++ | UtilityLib/Src/Serialization/Base64.cpp | toumilov/UtilityLib | e97094fb3460b466803be8445e812e9e3cb837d7 | [
"MIT"
] | null | null | null | UtilityLib/Src/Serialization/Base64.cpp | toumilov/UtilityLib | e97094fb3460b466803be8445e812e9e3cb837d7 | [
"MIT"
] | null | null | null | UtilityLib/Src/Serialization/Base64.cpp | toumilov/UtilityLib | e97094fb3460b466803be8445e812e9e3cb837d7 | [
"MIT"
] | null | null | null |
#include <algorithm>
#include <cstring>
#include "Serialization/Base64.hpp"
namespace UtilityLib {
namespace Serialization {
static const std::string mapping_ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static void process_chunk( const char *chunk, std::string &result )
{
result += mapping_[( chunk[0] & 0xfc ) >> 2];
result += mapping_[( ( chunk[0] & 0x03 ) << 4 ) + ( ( chunk[1] & 0xf0 ) >> 4 )];
result += mapping_[( ( chunk[1] & 0x0f ) << 2 ) + ( ( chunk[2] & 0xc0 ) >> 6 )];
result += mapping_[chunk[2] & 0x3f];
}
static bool hex_nibble_to_byte( char ch, char &byte )
{
if ( ch >= '0' && ch <= '9' )
{
byte |= ch - '0';
}
else if ( ch >= 'A' && ch <= 'F' )
{
byte |= ch - 'A' + 10;
}
else if ( ch >= 'a' && ch <= 'f' )
{
byte |= ch - 'a' + 10;
}
else
{
return false;
}
return true;
}
static bool hex_byte( char hi, char lo, char &byte )
{
if ( !hex_nibble_to_byte( hi, byte ) )
{
return false;
}
byte <<= 4;
if ( !hex_nibble_to_byte( lo, byte ) )
{
return false;
}
return true;
}
static bool process_hex_chunk( const char *chunk, std::string &result )
{
char b1 = 0, b2 = 0, b3 = 0;
if ( !hex_byte( chunk[0], chunk[1], b1 ) ||
( chunk[2] && !hex_byte( chunk[2], chunk[3], b2 ) ) ||
( chunk[4] && !hex_byte( chunk[4], chunk[5], b3 ) ) )
{
return false;
}
result += mapping_[( b1 & 0xfc ) >> 2];
result += mapping_[( ( b1 & 0x03 ) << 4 ) + ( ( b2 & 0xf0 ) >> 4 )];
result += mapping_[( ( b2 & 0x0f ) << 2 ) + ( ( b3 & 0xc0 ) >> 6 )];
result += mapping_[b3 & 0x3f];
return true;
}
static unsigned index_by_char( char c )
{
if ( c == '=' )
{
return 0;
}
auto pos = mapping_.find( c );
return ( pos == std::string::npos ) ? 0 : pos;
}
static void append_byte_as_hex( std::string &str, char byte )
{
char tmp = ( byte & 0xf0 ) >> 4;
str += ( tmp + ( ( tmp > 9 ) ? 'a' - 10 : '0' ) );
tmp = byte & 0x0f;
str += ( tmp + ( ( tmp > 9 ) ? 'a' - 10 : '0' ) );
}
bool Base64::validate( const std::string &data )
{
static const bool ascii_base64[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
if ( ( data.size() % 4 ) != 0 )
{
return false;
}
for( auto it = data.begin(); it != data.end(); ++it )
{
if ( !ascii_base64[(int)*it] )
{
return false;
}
}
int num = std::count( data.begin(), data.end(), '=' );
if ( num > 2 )
{
return false;
}
for( ; num > 0; num-- )
{
if ( data[data.size() - num] != '=' )
{
return false;
}
}
return true;
}
std::string Base64::encode( const char *data, unsigned len )
{
std::string result;
unsigned result_len = ( ( len * 8u ) / 6u ) + ( ( len * 8u ) % 6u ? 1 : 0 );
unsigned padding_len = ( ( result_len + 3u ) & ~3u ) - result_len;
result_len = ( result_len + 3u ) & ~3u;
result.reserve( result_len );
const char *p = data;
for( ; len > 2; len -= 3, p += 3 )
{
process_chunk( p, result );
}
if ( len )
{
char leftover[4] = {0};
for( unsigned i = 0; len > 0; len--, i++, p++ )
{
leftover[i] = *p;
}
process_chunk( leftover, result );
for( unsigned i = 0; i < padding_len; i++ )
{
result[result.size() - i - 1] = '=';
}
}
return result;
}
std::string Base64::encode_hex( const char *data, unsigned len )
{
std::string result;
if ( len % 2 )
{
return result;
}
len /= 2;
unsigned result_len = ( ( len * 8u ) / 6u ) + ( ( len * 8u ) % 6u ? 1 : 0 );
unsigned padding_len = ( ( result_len + 3u ) & ~3u ) - result_len;
result_len = ( result_len + 3u ) & ~3u;
result.reserve( result_len );
const char *p = data;
for( ; len > 2; len -= 3, p += 6 )
{
if ( !process_hex_chunk( p, result ) )
{
return "";
}
}
if ( len )
{
char leftover[6] = {0};
len *= 2;
for( unsigned i = 0; len > 0; len--, i++, p++ )
{
leftover[i] = *p;
}
if ( !process_hex_chunk( leftover, result ) )
{
return "";
}
for( unsigned i = 0; i < padding_len; i++ )
{
result[result.size() - i - 1] = '=';
}
}
return result;
}
std::vector<char> Base64::decode( const std::string &data )
{
std::vector<char> result;
if ( validate( data ) )
{
result.reserve( decoded_size( data ) );
char buf[4];
for( unsigned i = 0; i < data.size(); i += 4 )
{
buf[0] = index_by_char( data[i] );
buf[1] = (char)index_by_char( data[i+1] );
buf[2] = (char)index_by_char( data[i+2] );
buf[3] = (char)index_by_char( data[i+3] );
result.push_back( ( buf[0] << 2 ) + ( ( buf[1] & 0x30 ) >> 4 ) );
result.push_back( ( ( buf[1] & 0x0f ) << 4 ) + ( ( buf[2] & 0x3c ) >> 2 ) );
result.push_back( ( ( buf[2] & 0x03 ) << 6 ) + ( buf[3] & 0x3f ) );
}
auto pos = data.find( "=" );
switch( pos )
{
case std::string::npos:
break;
default:
result.resize( result.size() - ( data.size() - pos ) );
}
}
return result;
}
std::string Base64::decode_hex( const std::string &data )
{
std::string result;
if ( validate( data ) )
{
result.reserve( decoded_size( data ) );
char buf[4];
for( unsigned i = 0; i < data.size(); i += 4 )
{
buf[0] = index_by_char( data[i] );
buf[1] = (char)index_by_char( data[i+1] );
buf[2] = (char)index_by_char( data[i+2] );
buf[3] = (char)index_by_char( data[i+3] );
append_byte_as_hex( result, ( buf[0] << 2 ) + ( ( buf[1] & 0x30 ) >> 4 ) );
append_byte_as_hex( result, ( ( buf[1] & 0x0f ) << 4 ) + ( ( buf[2] & 0x3c ) >> 2 ) );
append_byte_as_hex( result, ( ( buf[2] & 0x03 ) << 6 ) + ( buf[3] & 0x3f ) );
}
auto pos = data.find( "=" );
switch( pos )
{
case std::string::npos:
break;
default:
result.resize( result.size() - ( data.size() - pos ) * 2 );
}
}
return result;
}
unsigned Base64::encoded_size( unsigned size )
{
return ( ( size + ( 3 - 1 ) ) / 3 ) * 4;
}
unsigned Base64::decoded_size( const std::string &encoded )
{
unsigned padding_chars = 0;
int i = encoded.size() - 1;
while( true )
{
if ( i <= 0 || encoded[i] != '=' )
{
break;
}
i--;
padding_chars++;
}
return ( ( encoded.size() * 3 ) / 4 ) - padding_chars;
}
} // namespace Serialization
} // namespace UtilityLib
| 29.014388 | 104 | 0.43268 | [
"vector"
] |
c4f1c3b529cea74b28e2382c62f699a66c11ebd4 | 941 | cpp | C++ | LeetCodeCPP/997. Find the Town Judge/main.cpp | 18600130137/leetcode | fd2dc72c0b85da50269732f0fcf91326c4787d3a | [
"Apache-2.0"
] | 1 | 2019-03-29T03:33:56.000Z | 2019-03-29T03:33:56.000Z | LeetCodeCPP/997. Find the Town Judge/main.cpp | 18600130137/leetcode | fd2dc72c0b85da50269732f0fcf91326c4787d3a | [
"Apache-2.0"
] | null | null | null | LeetCodeCPP/997. Find the Town Judge/main.cpp | 18600130137/leetcode | fd2dc72c0b85da50269732f0fcf91326c4787d3a | [
"Apache-2.0"
] | null | null | null | //
// main.cpp
// 997. Find the Town Judge
//
// Created by admin on 2019/2/25.
// Copyright © 2019年 liu. All rights reserved.
//
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
class Solution {
public:
int findJudge(int N, vector<vector<int>>& trust) {
if(trust.size()==0 && N==1){
return 1;
}
unordered_map<int,int> helper;
for(auto item:trust){
helper[item[1]]++;
helper[item[0]]--;
}
for(auto item:helper){
if(item.second==N-1){
return item.first;
}
}
return -1;
}
};
int main(int argc, const char * argv[]) {
int input1=4;
vector<vector<int>> input2={{1,3},{1,4},{2,3},{2,4},{4,3}};
Solution so=Solution();
int ret=so.findJudge(input1, input2);
cout<<"The ret is:"<<ret<<endl;
return 0;
}
| 20.021277 | 63 | 0.511158 | [
"vector"
] |
c4fafe46e00a8c8259aa55eba9ad94a869faf39c | 2,579 | hpp | C++ | tracking/archival_manager.hpp | smartyw/organicmaps | 9b10eb9d3ed6833861cef294c2416cc98b15e10d | [
"Apache-2.0"
] | 4,879 | 2015-09-30T10:56:36.000Z | 2022-03-31T18:43:03.000Z | tracking/archival_manager.hpp | smartyw/organicmaps | 9b10eb9d3ed6833861cef294c2416cc98b15e10d | [
"Apache-2.0"
] | 7,549 | 2015-09-30T10:52:53.000Z | 2022-03-31T22:04:22.000Z | tracking/archival_manager.hpp | smartyw/organicmaps | 9b10eb9d3ed6833861cef294c2416cc98b15e10d | [
"Apache-2.0"
] | 1,493 | 2015-09-30T10:43:06.000Z | 2022-03-21T09:16:49.000Z | #pragma once
#include "routing/router.hpp"
#include "coding/file_writer.hpp"
#include "base/logging.hpp"
#include <chrono>
#include <cstdint>
#include <exception>
#include <optional>
#include <string>
#include <utility>
#include <vector>
namespace tracking
{
struct ArchivingSettings
{
size_t m_minFreeSpaceOnDiskBytes = 30 * 1024 * 1024; // 30 Mb
size_t m_dumpIntervalSeconds = 60;
size_t m_maxFilesToSave = 100;
size_t m_maxArchivesToSave = 10;
size_t m_uploadIntervalSeconds = 60 * 60 * 24;
uint32_t m_version = 1;
};
/// \returns path to the directory with the tracks.
std::string GetTracksDirectory();
class ArchivalManager
{
public:
ArchivalManager(std::string const & url);
ArchivalManager(ArchivalManager const &) = delete;
ArchivalManager & operator=(ArchivalManager const &) = delete;
void SetSettings(ArchivingSettings const & settings);
/// \brief Saves to file contents of the |archive| if it is necessary to |dumpAnyway|
/// or the |archive| is ready to be dumped.
template <class T>
void Dump(T & archive, routing::RouterType const & trackType, bool dumpAnyway);
/// \returns time span between Archive dumps.
size_t IntervalBetweenDumpsSeconds();
/// \brief Prepares zipped files and creates task for uploading them.
void PrepareUpload();
/// \brief Deletes the oldest files if the total number of archive files is exceeded.
void DeleteOldDataByExtension(std::string const & extension) const;
private:
bool ReadyToUpload();
size_t GetTimeFromLastUploadSeconds();
size_t GetMaxSavedFilesCount(std::string const & extension) const;
std::chrono::seconds ReadTimestamp(std::string const & filePath);
void WriteTimestamp(std::string const & filePath);
std::optional<FileWriter> GetFileWriter(routing::RouterType const & trackType) const;
std::vector<std::string> GetFilesOrderedByCreation(std::string const & extension) const;
bool CreateTracksDir() const;
bool CanDumpToDisk(size_t neededFreeSpace) const;
void PrepareUpload(std::vector<std::string> const & files);
void CreateUploadTask(std::string const & filePath);
std::string const m_url;
ArchivingSettings m_settings;
std::string m_tracksDir;
std::string m_timestampFile;
};
template <class T>
void ArchivalManager::Dump(T & archive, routing::RouterType const & trackType, bool dumpAnyway)
{
if (!(archive.ReadyToDump() || (dumpAnyway && archive.Size() > 0)))
return;
if (!CanDumpToDisk(archive.Size()))
return;
if (auto dst = GetFileWriter(trackType))
archive.Write(*dst);
}
} // namespace tracking
| 28.032609 | 95 | 0.738658 | [
"vector"
] |
c4fee4d0717657aacc6d95339243ac396d175846 | 1,813 | cpp | C++ | example/example.cpp | qingl812/microlife-json | 69042e12a7c30941e701e1863e92d450713f216c | [
"MIT"
] | null | null | null | example/example.cpp | qingl812/microlife-json | 69042e12a7c30941e701e1863e92d450713f216c | [
"MIT"
] | null | null | null | example/example.cpp | qingl812/microlife-json | 69042e12a7c30941e701e1863e92d450713f216c | [
"MIT"
] | null | null | null | #include "microlife/json.hpp"
#include <iostream>
using json = microlife::json;
int main() {
// 解析json
{
json j;
j.parse("{\"a\":1,\"b\":2}");
std::cout << (j.is_object() ? "is object" : "not object") << std::endl;
auto a = j.get<json::object_t&>().find("a");
auto b = j.get<json::object_t&>().find("b");
std::cout << a->first << ": " << a->second << std::endl;
std::cout << b->first << ": " << b->second << std::endl;
}
std::cout << std::endl;
// 序列化 json 数据
{
json::object_t object;
object["a"] = 1;
object["b"] = 2;
json j = object;
std::cout << j.dump() << std::endl;
}
std::cout << std::endl;
// json 数据的操作
{
json json_null = nullptr;
std::cout << json_null.type() << ": ";
json json_bool = true;
std::cout << json_bool.type() << ": ";
std::cout << json_bool.get<bool>() << std::endl;
json json_num = 3.14;
std::cout << json_num.type() << ": ";
std::cout << json_num.get<double>() << std::endl;
json json_str = "hello json";
std::cout << json_str.type() << ": ";
std::cout << json_str.get<std::string>() << std::endl;
json json_array = json::array_t({1, 2, 3});
std::cout << json_array.type() << ": ";
std::cout << json_array.get<json::array_t&>()[0] << std::endl;
json json_object = json::object_t({{"a", 1}, {"b", 2}});
std::cout << json_object.type() << ": ";
std::cout << json_object.get<json::object_t&>().at("a") << std::endl;
std::cout << std::endl;
json json_cnt(3, true);
std::cout << json_cnt.type() << ": ";
std::cout << json_cnt.get<json::array_t&>().size() << std::endl;
}
} | 29.241935 | 79 | 0.47711 | [
"object"
] |
f203a36c34314934b0221615ca2144e41fa6fa20 | 5,715 | cpp | C++ | demo/png_2d_planning.cpp | elishafer/mpt | e0997259fbd1431bab4b5ffb6f0d2f00fa380660 | [
"BSD-3-Clause"
] | 54 | 2018-09-28T17:28:02.000Z | 2022-01-25T20:30:32.000Z | demo/png_2d_planning.cpp | elishafer/mpt | e0997259fbd1431bab4b5ffb6f0d2f00fa380660 | [
"BSD-3-Clause"
] | 2 | 2019-11-21T20:16:26.000Z | 2020-03-27T12:55:31.000Z | demo/png_2d_planning.cpp | elishafer/mpt | e0997259fbd1431bab4b5ffb6f0d2f00fa380660 | [
"BSD-3-Clause"
] | 27 | 2019-05-15T00:18:46.000Z | 2021-07-30T00:41:37.000Z | // Software License Agreement (BSD-3-Clause)
//
// Copyright 2018 The University of North Carolina at Chapel Hill
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
//! @author William Lee
#include "png_2d_scenario.hpp"
#include "shape_hierarchy.hpp"
#include <vector>
#include <png.h>
#include <mpt/prrt_star.hpp>
#include <mpt/prrt.hpp>
#include <mpt/pprm.hpp>
using namespace mpt_demo;
using namespace unc::robotics::mpt;
using namespace mpt_demo;
using namespace std::literals;
using namespace shape;
using Scalar = double;
using State = Eigen::Matrix<Scalar, 2, 1>;
using Algorithm = PRRTStar<>;
using Scenario = PNG2dScenario<Scalar>;
const std::string inputName = "../../png_planning_input.png";
// draws the result to a svg file.
void writeSvgFile(Planner<Scenario, Algorithm> &, Scenario &, State &, State &);
int main(int argc, char *argv[])
{
/*
* 1. Choose the obstacle colors to be filtered.
*
* FilterColor takes four parameters: r, g, b, and tolerance. It will be used
* to filter each pixel that is within the tolerance of the given rgb color.
*/
std::vector<FilterColor> filters;
filters.push_back(FilterColor(126, 106, 61, 15));
filters.push_back(FilterColor(61, 53, 6, 15));
filters.push_back(FilterColor(255, 255, 255, 5));
/*
* 2. Read and filter the input image.
*
* boolean vector "obstacles" will be used to track the obstacles.
* For each pixel (x, y), it is an obstacle iff obstacles(y * width + x).
*/
auto [obstacles, width, height] = readAndFilterPng(filters, inputName);
/*
* 3. Set the start state and the goal state, then initialize scenario.
*/
State startState, goalState;
startState << 430, 1300;
goalState << 3150, 950;
Scenario scenario(width, height, goalState, obstacles);
/*
* 4. Initialize and run the planner.
*
* We initialize the planner with the scenario above. Then, we add the
* start state and run the planner for MAX_SOLVE_TIME (milliseconds).
* Planner will use the specified algorithm to explore possible paths
* from the start to the goal state in the given scenario.
*/
static constexpr auto MAX_SOLVE_TIME = 50ms; // maximum runtime allotted for the planner.
Planner<Scenario, Algorithm> planner(scenario);
planner.addStart(startState);
planner.solveFor(MAX_SOLVE_TIME);
planner.printStats();
writeSvgFile(planner, scenario, startState, goalState); // write the result to svg.
return 0;
}
inline void writeSvgFile(Planner<Scenario, Algorithm> &planner, Scenario &scenario, State &start, State &goal)
{
std::vector<State> solution = planner.solution();
if (solution.empty())
{
MPT_LOG(INFO) << "No solution was found";
return;
}
const std::string outputName = "png_2d_demo_output.svg";
std::ofstream file(outputName);
startSvg(file, scenario.width(), scenario.height());
addBackgroundImg(file, inputName);
MPT_LOG(INFO) << "Writing the solution to " << outputName;
// Struct Visitor will be used to traverse the explored paths.
//
// It must supply two functions: vertex and edge. Vertex(q) should set the current node (from_) to q.
// Then, the planner calls edge(to) to add each edge(from_, to) to the svg file.
struct Visitor
{
std::ofstream &out_;
State from_;
Visitor(std::ofstream &out) : out_(out) {}
void vertex(const State &q)
{
from_ = q;
}
void edge(const State &to)
{
addVisitedEdge(out_, from_[0], from_[1], to[0], to[1], 0.3);
}
};
planner.visitGraph(Visitor(file));
// draw the solution paths
if (!solution.empty())
{
for (auto it = solution.begin(); it + 1 != solution.end() ; ++it)
{
const auto &from = *it;
const auto &to = *(it + 1);
addSolutionEdge(file, from[0], from[1], to[0], to[1], 10.0);
}
}
// add the start state and the end state.
addStartState(file, start[0], start[1], 40);
addGoalState(file, goal[0], goal[1], 40);
endSvg(file);
}
| 34.427711 | 110 | 0.671041 | [
"shape",
"vector"
] |
f206b7b104ddf634456d8d6ee86e0b6ab66b4de0 | 16,791 | cpp | C++ | src_segmenter/Lib/normxcorr2_mex_ALL/cv_src/cverror.cpp | angelolab/MIBI_GUI | ad4ede6b65c4e3772122e77986ab5922cb631319 | [
"BSD-3-Clause"
] | 1 | 2021-04-28T16:51:44.000Z | 2021-04-28T16:51:44.000Z | cv_src/cverror.cpp | charismaticchiu/Change_detection_patchmatch | 46000495cf207f55af5a1f717cdce1e75d52f2a6 | [
"BSD-2-Clause"
] | 4 | 2021-06-25T21:36:47.000Z | 2022-02-04T21:47:29.000Z | cv_src/cverror.cpp | charismaticchiu/Change_detection_patchmatch | 46000495cf207f55af5a1f717cdce1e75d52f2a6 | [
"BSD-2-Clause"
] | 1 | 2020-01-28T19:46:34.000Z | 2020-01-28T19:46:34.000Z | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "_cv.h"
#include <stdio.h>
#ifdef WIN32
#include <windows.h>
#else
#include <pthread.h>
#endif
CvContext* icvCreateContext()
{
CvContext* context = (CvContext*)malloc( sizeof( CvContext ) );
context->CVErrMode = CV_ErrModeLeaf;
context->CVLastStatus = CV_StsOk;
#ifdef WIN32
context->CVErrorFunc = cvGuiBoxReport;
#else
context->CVErrorFunc = cvStdErrReport;
#endif
/* below is stuff for profiling */
context->CVStackCapacity = 100; /* let it be so*/
context->CVStackSize = 0;
context->CVStack =
(CvStackRecord*)malloc( sizeof(CvStackRecord) * context->CVStackCapacity );
return context;
}
void icvDestroyContext(CvContext* context)
{
free(context->CVStack);
free(context);
}
#ifdef WIN32
DWORD g_TlsIndex = TLS_OUT_OF_INDEXES;
#else
pthread_key_t g_TlsIndex;
#endif
CvContext* icvGetContext()
{
#ifdef CV_DLL
#ifdef WIN32
CvContext* pContext = (CvContext*)TlsGetValue( g_TlsIndex );
if( !pContext )
{
pContext = icvCreateContext();
if( !pContext )
{
FatalAppExit( 0, "OpenCV. Problem to allocate memory for TLS OpenCV context." );
}
TlsSetValue( g_TlsIndex, pContext );
}
return pContext;
#else
CvContext* pContext = (CvContext*)pthread_getspecific( g_TlsIndex );
if( !pContext )
{
pContext = icvCreateContext();
if( !pContext )
{
fprintf(stderr,"OpenCV. Problem to allocate memory for OpenCV context.");
exit(1);
}
pthread_setspecific( g_TlsIndex, pContext );
}
return pContext;
#endif
#else /* CV_DLL */
static CvContext* pContext = 0;
if( !pContext )
pContext = icvCreateContext();
return pContext;
#endif
}
CV_IMPL CVStatus cvStdErrReport( CVStatus status, const char *funcName,
const char *context, const char *file, int line )
{
CvContext* cont = icvGetContext();
if ( cvGetErrMode() == CV_ErrModeSilent )
return ( status != CV_StsBackTrace ) ? ( cont->CVLastStatus = status ) : status;
if (( status == CV_StsBackTrace ) || ( status == CV_StsAutoTrace ))
fprintf(stderr, "\tcalled from ");
else
{
cont->CVLastStatus = status;
fprintf(stderr, "OpenCV Error: %s \n\tin function ", cvErrorStr(status));
}
if ( line > 0 || file != NULL )
fprintf(stderr,"[%s:%d]", file, line);
fprintf(stderr,":%s", funcName ? funcName : "<unknown>");
if ( context != NULL ) {
if ( status != CV_StsAutoTrace )
fprintf(stderr, "():\n%s", context); /* Print context */
else
fprintf(stderr, "(%s)", context); /* Print arguments */
}
fprintf(stderr, "\n");
if ( cont->CVErrMode == CV_ErrModeLeaf ) {
fprintf(stderr, "OpenCV: %s\n","terminating the application");
exit(1);
};
return status;
}
CV_IMPL CVStatus cvGuiBoxReport( CVStatus status, const char *funcName,
const char *context, const char *file, int line)
{
#ifdef WIN32
char mess[1000];
char title[100];
char *choice = 0;
const char* errText = cvErrorStr( status );
if ( cvGetErrMode() != CV_ErrModeSilent )
{
if( !funcName ) funcName = "<unknown>";
if( !context ) context = "";
if( !file ) file = "";
if( line < 0 ) line = 0;
if( cvGetErrMode() == CV_ErrModeLeaf )
choice="\nErrMode=CV_ErrorModeLeaf\n"
"\nTerminate the application?";
if( cvGetErrMode() == CV_ErrModeParent)
choice="\nErrMode=CV_ErrorModeParent\n"
"\nContinue?";
if( status == CV_StsBackTrace)
wsprintf( mess,"Called from %s(): [file %s, line %d]\n%s\n%s\n(status:%d)\n%s",
funcName, file,line,context, errText, status, choice);
else if ( status == CV_StsAutoTrace )
wsprintf( mess,"Called from %s(): [file %s, line %d]\n%s\n%s\n(status:%d)\n%s",
funcName, file, line, context, errText, status, choice);
else
wsprintf( mess,"In function %s(): [file %s, line %d]\n%s\n%s\n(status:%d)\n%s",
funcName, file, line, context,errText, status, choice);
wsprintf(title,"OpenCV Beta 2: %s",cvErrorStr(cvGetErrStatus()));
int answer = -1;
if( (( cvGetErrMode()==CV_ErrModeParent) &&
(IDCANCEL==MessageBox(NULL,mess,title,MB_ICONERROR|MB_OKCANCEL|MB_SYSTEMMODAL) ) ||
((cvGetErrMode() == CV_ErrModeLeaf) &&
//(IDYES==MessageBox(NULL,mess,title,MB_ICONERROR|MB_YESNO|MB_SYSTEMMODAL))
(IDABORT == (answer=MessageBox(NULL,mess,title,MB_ICONERROR|MB_ABORTRETRYIGNORE|MB_SYSTEMMODAL))||
IDRETRY == answer)
)))
{
if( answer == IDRETRY )
{
#if _MSC_VER >= 1200 || defined __ICL
__asm int 3;
#else
assert(0);
#endif
}
FatalAppExit(0,"OpenCV:\nterminating the application");
}
}
#else
cvStdErrReport( status, funcName, context, file, line);
#endif
return status;
}
CV_IMPL CVStatus cvNulDevReport( CVStatus status, const char *funcName,
const char *context, const char *file, int line)
{
if( status||funcName||context||file||line )
if ( cvGetErrMode() == CV_ErrModeLeaf )
exit(1);
return status;
}
CV_IMPL CVErrorCallBack cvRedirectError(CVErrorCallBack func)
{
CvContext* context = icvGetContext();
CVErrorCallBack old = context->CVErrorFunc;
context->CVErrorFunc = func;
return old;
}
CV_IMPL const char* cvErrorStr(CVStatus status)
{
static char buf[80];
switch (status)
{
case CV_StsOk : return "No Error";
case CV_StsBackTrace : return "Backtrace";
case CV_StsError : return "Unknown error";
case CV_StsInternal : return "Internal error";
case CV_StsNoMem : return "Insufficient memory";
case CV_StsBadArg : return "Bad argument";
case CV_StsNoConv : return "Iteration convergence failed";
case CV_StsAutoTrace : return "Autotrace call";
case CV_StsBadSize : return "Bad/unsupported parameter of type CvSize";
case CV_StsNullPtr : return "Null pointer";
case CV_StsDivByZero : return "Divizion by zero occured";
case CV_BadStep : return "Image step is wrong";
case CV_StsInplaceNotSupported : return "Inplace operation is not supported";
case CV_StsObjectNotFound : return "Requested object was not found";
case CV_BadDepth : return "Input image depth is not supported by function";
case CV_StsUnmatchedFormats : return "Formats of input arguments do not match";
case CV_StsUnmatchedSizes : return "Sizes of input arguments do not match";
case CV_StsOutOfRange : return "One of arguments\' values is out of range";
case CV_StsUnsupportedFormat : return "Unsupported format or combination of formats";
case CV_BadCOI : return "Input COI is not supported";
case CV_BadNumChannels : return "Bad number of channels";
case CV_StsBadFlag : return "Bad flag (parameter or structure field)";
case CV_StsBadPoint : return "Bad parameter of type CvPoint";
};
sprintf(buf, "Unknown %s code %d", status >= 0 ? "status":"error", status);
return buf;
}
CV_IMPL int cvGetErrMode(void)
{
return icvGetContext()->CVErrMode;
}
CV_IMPL void cvSetErrMode( int mode )
{
icvGetContext()->CVErrMode = mode;
}
CV_IMPL CVStatus cvGetErrStatus()
{
return icvGetContext()->CVLastStatus;
}
CV_IMPL void cvSetErrStatus(CVStatus status)
{
icvGetContext()->CVLastStatus = status;
}
/******************** Implementation of profiling stuff *********************/
/* initial assignment of profiling functions */
CvStartProfileFunc p_cvStartProfile = cvStartProfile;
CvEndProfileFunc p_cvEndProfile = cvEndProfile;
CV_IMPL void cvSetProfile( void (CV_CDECL *startprofile_f)(const char*, const char*, int),
void (CV_CDECL *endprofile_f)(const char*, int))
{
p_cvStartProfile = startprofile_f;
p_cvEndProfile = endprofile_f;
}
CV_IMPL void cvRemoveProfile()
{
p_cvStartProfile = cvStartProfile;
p_cvEndProfile = cvEndProfile;
}
/* default implementation of cvStartProfile & cvEndProfile */
void CV_CDECL cvStartProfile(const char* call, const char* file, int line )
{
#ifdef _CV_COMPILE_PROFILE_
if( p_cvStartProfile != cvStartProfile )
{
p_cvStartProfile( call, file, line );
}
/* default implementation */
CvContext* context = icvGetContext();
/* add record to stack */
assert( context->CVStackCapacity >= context->CVStackSize );
if( context->CVStackCapacity == context->CVStackSize )
{
/* increase stack */
context->CVStackCapacity += 100;
context->CVStack = (CvStackRecord*)realloc( context->CVStack,
(context->CVStackCapacity) * sizeof(CvStackRecord) );
}
CvStackRecord* rec = &context->CVStack[context->CVStackSize];
rec->file = file;
rec->line = line;
context->CVStackSize++;
#else
/* avoid warning "unreferenced value" */
if( call||file||line) {}
assert(0);
#endif
};
CV_IMPL void cvEndProfile( const char* file, int line )
{
#ifdef _CV_COMPILE_PROFILE_
CvContext* context = icvGetContext();
if( p_cvEndProfile != cvEndProfile )
{
p_cvEndProfile( file, line );
}
/* default implementation */
context->CVStackSize--;
#else
/* avoid warning "unreferenced value" */
if( file||line) {}
assert(0);
#endif
};
CV_IMPL CVStatus cvError( CVStatus code, const char* funcName,
const char* msg, const char* file, int line )
{
CvContext* context = icvGetContext();
if ((code!=CV_StsBackTrace) && (code!=CV_StsAutoTrace))
cvSetErrStatus(code);
if (code == CV_StsOk)
return CV_StsOk;
#ifdef _CV_COMPILE_PROFILE_
int i;
char message[4096] = "";
/* copy input message */
strcpy( message, msg );
/* append stack info */
strcat( message, "\nStack\n{" );
char* mes = message + strlen(message);
for( i = 0; i < context->CVStackSize; i++ )
{
i ? 0 : sprintf( mes,"\n" ), mes += strlen(mes);
CvStackRecord* rec = &(context->CVStack[i]);
sprintf( mes, " %s line %d\n", rec->file, rec->line );
mes += strlen(mes);
}
strcat( message, "}\n" );
context->CVErrorFunc( code, funcName, message, file, line );
#else
context->CVErrorFunc( code, funcName, msg, file, line );
#endif
return code;
};
CV_IMPL void cvGetCallStack(CvStackRecord** stack, int* size)
{
CvContext* context = icvGetContext();
*stack = context->CVStack;
*size = context->CVStackSize;
}
/******************** End of implementation of profiling stuff *********************/
/**********************DllMain********************************/
#ifdef CV_DLL
#ifdef WIN32
BOOL WINAPI DllMain( HINSTANCE /*hinstDLL*/, /* DLL module handle */
DWORD fdwReason, /* reason called */
LPVOID /*lpvReserved*/) /* reserved */
{
CvContext *pContext;
/// Note the actual size of the structure is larger.
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
g_TlsIndex = TlsAlloc();
if( g_TlsIndex == TLS_OUT_OF_INDEXES ) return FALSE;
/* No break: Initialize the index for first thread. */
/* The attached process creates a new thread. */
case DLL_THREAD_ATTACH:
pContext = icvCreateContext();
if( pContext == NULL)
return FALSE;
TlsSetValue( g_TlsIndex, (LPVOID)pContext );
break;
case DLL_THREAD_DETACH:
if( g_TlsIndex != TLS_OUT_OF_INDEXES )
{
pContext = (CvContext*)TlsGetValue( g_TlsIndex );
if( pContext != NULL )
{
icvDestroyContext( pContext );
}
}
break;
case DLL_PROCESS_DETACH:
if( g_TlsIndex != TLS_OUT_OF_INDEXES ) {
pContext = (CvContext*)TlsGetValue( g_TlsIndex );
if( pContext != NULL )
{
icvDestroyContext( pContext );
}
TlsFree( g_TlsIndex );
}
break;
default:
break;
}
return TRUE;
}
#else
/* POSIX pthread */
/* function - destructor of thread */
void icvPthreadDestructor(void* key_val)
{
CvContext* context = (CvContext*) key_val;
icvDestroyContext( context );
}
int pthrerr = pthread_key_create( &g_TlsIndex, icvPthreadDestructor );
#endif
#endif
/* function, which converts CvStatus to CVStatus */
IPCVAPI_IMPL( CVStatus, icvErrorFromStatus, ( CvStatus status ) )
{
switch (status)
{
case CV_BADSIZE_ERR : return CV_StsBadSize; //bad parameter of type CvSize
case CV_NULLPTR_ERR : return CV_StsNullPtr;
case CV_DIV_BY_ZERO_ERR : return CV_StsDivByZero;
case CV_BADSTEP_ERR : return CV_BadStep ;
case CV_OUTOFMEM_ERR : return CV_StsNoMem;
case CV_BADARG_ERR : return CV_StsBadArg;
case CV_NOTDEFINED_ERR : return CV_StsError; //unknown/undefined err
case CV_INPLACE_NOT_SUPPORTED_ERR: return CV_StsInplaceNotSupported;
case CV_NOTFOUND_ERR : return CV_StsObjectNotFound;
case CV_BADCONVERGENCE_ERR: return CV_StsNoConv;
case CV_BADDEPTH_ERR : return CV_BadDepth;
case CV_UNMATCHED_FORMATS_ERR : return CV_StsUnmatchedFormats;
case CV_UNSUPPORTED_COI_ERR : return CV_BadCOI;
case CV_UNSUPPORTED_CHANNELS_ERR : return CV_BadNumChannels;
case CV_BADFLAG_ERR : return CV_StsBadFlag;//used when bad flag CV_ ..something
case CV_BADRANGE_ERR : return CV_StsBadArg; //used everywhere
case CV_BADCOEF_ERR :return CV_StsBadArg; //used everywhere
case CV_BADFACTOR_ERR:return CV_StsBadArg; //used everywhere
case CV_BADPOINT_ERR :return CV_StsBadPoint;
default: assert(0); return CV_StsError;
}
}
/* End of file */
| 31.385047 | 111 | 0.613603 | [
"object"
] |
f2185441fba5a408c60340627d1a7d0bb7de4d59 | 1,449 | cpp | C++ | include/extra/MouseShootFeature.cpp | hvidal/GameEngine3D | 1794ad891d2200260be935283645a03af3ebcfcc | [
"MIT"
] | 6 | 2020-07-03T21:14:56.000Z | 2021-11-11T09:37:40.000Z | include/extra/MouseShootFeature.cpp | hvidal/GameEngine3D | 1794ad891d2200260be935283645a03af3ebcfcc | [
"MIT"
] | null | null | null | include/extra/MouseShootFeature.cpp | hvidal/GameEngine3D | 1794ad891d2200260be935283645a03af3ebcfcc | [
"MIT"
] | 2 | 2020-08-15T22:37:21.000Z | 2021-01-17T11:31:27.000Z | #include "MouseShootFeature.h"
void MouseShootFeature::mouseDown(Uint8 button, int x, int y, const GameState& gameState)
{
// Not perfect, but SDL provides the button as Uint8, not as an enum class.
if (button == static_cast<int>(mActionButton) && gameState.mode == GameMode::RUNNING)
shoot(x, y);
}
void MouseShootFeature::shoot(int x, int y)
{
Log::debug("Shooting %d, %d", x, y);
std::shared_ptr<IGameScene> psGameScene = mGameScene.lock();
const ICamera* pCamera = psGameScene->getActiveCamera();
btTransform transform;
transform.setIdentity();
const btVector3& camPos = pCamera->getPosition();
transform.setOrigin(camPos);
std::shared_ptr<SphereShape> shape = std::make_shared<SphereShape>(8.f, 1.5f, mFilename, psGameScene->getDynamicsWorld());
mShapes.push_front(shape);
shape->initPhysics(transform);
psGameScene->addSceneObject(shape);
std::shared_ptr<btRigidBody> body = shape->getSharedRigidBody();
body->setLinearFactor(btVector3(1.f,1.f,1.f));
body->setRestitution(1);
const btVector3 rayTo = pCamera->getRayTo(x, y);
btVector3 linVel = rayTo - camPos;
linVel.normalize();
linVel *= 50.f; // shoot speed
body->getWorldTransform().setOrigin(camPos);
body->getWorldTransform().setRotation(btQuaternion(0,0,0,1));
body->setLinearVelocity(linVel);
body->setAngularVelocity(btVector3(0,0,0));
body->setCcdMotionThreshold(0.5);
body->setCcdSweptSphereRadius(0.9f);
mPlanet.lock()->interactWith(body);
} | 31.5 | 123 | 0.740511 | [
"shape",
"transform"
] |
35eb42e65b4177cc36429990c27353d6646c5c90 | 489 | cpp | C++ | C++/find-first-palindromic-string-in-the-array.cpp | Priyansh2/LeetCode-Solutions | d613da1881ec2416ccbe15f20b8000e36ddf1291 | [
"MIT"
] | 3,269 | 2018-10-12T01:29:40.000Z | 2022-03-31T17:58:41.000Z | C++/find-first-palindromic-string-in-the-array.cpp | Priyansh2/LeetCode-Solutions | d613da1881ec2416ccbe15f20b8000e36ddf1291 | [
"MIT"
] | 53 | 2018-12-16T22:54:20.000Z | 2022-02-25T08:31:20.000Z | C++/find-first-palindromic-string-in-the-array.cpp | Priyansh2/LeetCode-Solutions | d613da1881ec2416ccbe15f20b8000e36ddf1291 | [
"MIT"
] | 1,236 | 2018-10-12T02:51:40.000Z | 2022-03-30T13:30:37.000Z | // Time: O(n)
// Space: O(1)
class Solution {
public:
string firstPalindrome(vector<string>& words) {
for (const auto& w : words) {
if (is_palindrome(w)) {
return w;
}
}
return "";
}
private:
bool is_palindrome(const string& s) {
int i = 0, j = size(s) - 1;
while (i < j) {
if (s[i++] != s[j--]) {
return false;
}
}
return true;
}
};
| 18.807692 | 51 | 0.406953 | [
"vector"
] |
c409269d0d174250bd194d28373abb22e8bf4cf7 | 8,876 | cpp | C++ | grasp_generation/graspitmodified_lm/Coin-3.1.3/src/threads/rwmutex.cpp | KraftOreo/EBM_Hand | 9ab1722c196b7eb99b4c3ecc85cef6e8b1887053 | [
"MIT"
] | null | null | null | grasp_generation/graspitmodified_lm/Coin-3.1.3/src/threads/rwmutex.cpp | KraftOreo/EBM_Hand | 9ab1722c196b7eb99b4c3ecc85cef6e8b1887053 | [
"MIT"
] | null | null | null | grasp_generation/graspitmodified_lm/Coin-3.1.3/src/threads/rwmutex.cpp | KraftOreo/EBM_Hand | 9ab1722c196b7eb99b4c3ecc85cef6e8b1887053 | [
"MIT"
] | null | null | null | /**************************************************************************\
*
* This file is part of the Coin 3D visualization library.
* Copyright (C) by Kongsberg Oil & Gas Technologies.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* ("GPL") version 2 as published by the Free Software Foundation.
* See the file LICENSE.GPL at the root directory of this source
* distribution for additional information about the GNU GPL.
*
* For using Coin with software that can not be combined with the GNU
* GPL, and for taking advantage of the additional benefits of our
* support services, please contact Kongsberg Oil & Gas Technologies
* about acquiring a Coin Professional Edition License.
*
* See http://www.coin3d.org/ for more information.
*
* Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
* http://www.sim.no/ sales@sim.no coin-support@coin3d.org
*
\**************************************************************************/
#include <Inventor/C/threads/rwmutex.h>
#include <stdlib.h>
#include <assert.h>
#include <Inventor/C/errors/debugerror.h>
#include <Inventor/C/threads/mutex.h>
#include <Inventor/C/threads/condvar.h>
#include "threads/rwmutexp.h"
#include "tidbitsp.h"
/* ********************************************************************** */
/* debugging. for instance useful for checking that there's not
excessive mutex construction. */
/* these are declared in mutex.cpp */
extern unsigned int cc_debug_mtxcount;
extern const char * COIN_DEBUG_MUTEX_COUNT;
/**************************************************************************/
/*!
\internal
*/
void
cc_rwmutex_struct_init(cc_rwmutex * rwmutex)
{
cc_mutex_struct_init(&rwmutex->mutex);
cc_condvar_struct_init(&rwmutex->read);
cc_condvar_struct_init(&rwmutex->write);
rwmutex->readers = 0;
rwmutex->readwaiters = 0;
rwmutex->writers = 0;
rwmutex->writewaiters = 0;
rwmutex->policy = CC_READ_PRECEDENCE;
}
/*!
\internal
*/
void
cc_rwmutex_struct_clean(cc_rwmutex * rwmutex)
{
cc_mutex_struct_clean(&rwmutex->mutex);
cc_condvar_struct_clean(&rwmutex->read);
cc_condvar_struct_clean(&rwmutex->write);
}
/*
Construct a read-write mutex, with read precedence.
*/
cc_rwmutex *
cc_rwmutex_construct(void)
{
cc_rwmutex * rwmutex;
rwmutex = (cc_rwmutex *) malloc(sizeof(cc_rwmutex));
assert(rwmutex != NULL);
cc_rwmutex_struct_init(rwmutex);
{ /* debugging */
const char * env = coin_getenv(COIN_DEBUG_MUTEX_COUNT);
if (env && (atoi(env) > 0)) {
cc_debug_mtxcount += 1;
(void)fprintf(stderr, "DEBUG: live mutexes +1 => %u (rwmutex++)\n",
cc_debug_mtxcount);
}
}
return rwmutex;
}
/*
Construct a read-write mutex, with read precedence or write precedence.
*/
cc_rwmutex *
cc_rwmutex_construct_etc(enum cc_precedence policy)
{
cc_rwmutex * rwmutex;
assert((policy == CC_READ_PRECEDENCE) || (policy == CC_WRITE_PRECEDENCE));
rwmutex = cc_rwmutex_construct();
assert(rwmutex != NULL);
rwmutex->policy = policy;
return rwmutex;
}
/*
Destruct a read-write mutex.
*/
void
cc_rwmutex_destruct(cc_rwmutex * rwmutex)
{
{ /* debugging */
const char * env = coin_getenv(COIN_DEBUG_MUTEX_COUNT);
if (env && (atoi(env) > 0)) {
assert((cc_debug_mtxcount > 0) && "skewed mutex construct/destruct pairing");
cc_debug_mtxcount -= 1;
(void)fprintf(stderr, "DEBUG: live mutexes -1 => %u (rwmutex--)\n",
cc_debug_mtxcount);
}
}
assert(rwmutex != NULL);
cc_rwmutex_struct_clean(rwmutex);
free(rwmutex);
}
/* ********************************************************************** */
/*
*/
int
cc_rwmutex_write_lock(cc_rwmutex * rwmutex)
{
(void) cc_mutex_lock(&rwmutex->mutex);
if (rwmutex->readers == 0 &&
rwmutex->writers == 0 &&
rwmutex->readwaiters == 0 &&
rwmutex->writewaiters == 0) {
rwmutex->writers++;
(void) cc_mutex_unlock(&rwmutex->mutex);
return CC_OK;
}
rwmutex->writewaiters++;
/* loop in case some other thread acquires the lock while we wait
for the signal */
do {
(void) cc_condvar_wait(&rwmutex->write, &rwmutex->mutex);
} while (rwmutex->readers != 0 || rwmutex->writers != 0);
rwmutex->writers++;
rwmutex->writewaiters--;
assert(rwmutex->writewaiters >= 0);
(void) cc_mutex_unlock(&rwmutex->mutex);
return CC_OK;
} /* cc_rwmutex_write_lock() */
/*
*/
int
cc_rwmutex_write_try_lock(cc_rwmutex * rwmutex)
{
(void) cc_mutex_lock(&rwmutex->mutex);
if (rwmutex->readers == 0 &&
rwmutex->writers == 0 &&
rwmutex->readwaiters == 0 &&
rwmutex->writewaiters == 0) {
rwmutex->writers++;
(void) cc_mutex_unlock(&rwmutex->mutex);
return CC_OK;
}
(void) cc_mutex_unlock(&rwmutex->mutex);
return CC_BUSY;
} /* cc_rwmutex_write_try_lock() */
/*
*/
int
cc_rwmutex_write_unlock(cc_rwmutex * rwmutex)
{
int rwait;
int wwait;
(void) cc_mutex_lock(&rwmutex->mutex);
rwmutex->writers--;
assert(rwmutex->writers >= 0);
rwait = rwmutex->readwaiters;
wwait = rwmutex->writewaiters;
if (rwmutex->policy == CC_READ_PRECEDENCE) {
if (rwait) cc_condvar_wake_all(&rwmutex->read);
else cc_condvar_wake_one(&rwmutex->write);
}
else {
if (wwait) cc_condvar_wake_one(&rwmutex->write);
else cc_condvar_wake_all(&rwmutex->read);
}
(void) cc_mutex_unlock(&rwmutex->mutex);
return CC_OK;
}
/*
*/
int
cc_rwmutex_read_lock(cc_rwmutex * rwmutex)
{
assert(rwmutex != NULL);
(void) cc_mutex_lock(&rwmutex->mutex);
if (rwmutex->writers == 0) {
rwmutex->readers++;
(void) cc_mutex_unlock(&rwmutex->mutex);
return CC_OK;
}
rwmutex->readwaiters++;
/* loop in case some other thread acquires the lock while we wait
for the signal */
do {
(void) cc_condvar_wait(&rwmutex->read, &rwmutex->mutex);
} while (rwmutex->writers != 0);
rwmutex->readers++;
rwmutex->readwaiters--;
assert(rwmutex->readwaiters >= 0);
(void) cc_mutex_unlock(&rwmutex->mutex);
return CC_OK;
}
/*
*/
int
cc_rwmutex_read_try_lock(cc_rwmutex * rwmutex)
{
assert(rwmutex != NULL);
(void) cc_mutex_lock(&rwmutex->mutex);
if (rwmutex->writers == 0 &&
rwmutex->writewaiters == 0) {
rwmutex->readers++;
(void) cc_mutex_unlock(&rwmutex->mutex);
return CC_OK;
}
(void) cc_mutex_unlock(&rwmutex->mutex);
return CC_BUSY;
}
/*
*/
int
cc_rwmutex_read_unlock(cc_rwmutex * rwmutex)
{
int rwait;
int wwait;
int readers;
(void) cc_mutex_lock(&rwmutex->mutex);
rwmutex->readers--;
readers = rwmutex->readers;
assert(readers >= 0);
rwait = rwmutex->readwaiters;
wwait = rwmutex->writewaiters;
if (rwmutex->policy == CC_READ_PRECEDENCE || readers) {
if (rwait) cc_condvar_wake_all(&rwmutex->read);
else if (!readers) cc_condvar_wake_one(&rwmutex->write);
}
else {
if (wwait) cc_condvar_wake_one(&rwmutex->write);
else cc_condvar_wake_all(&rwmutex->read);
}
(void) cc_mutex_unlock(&rwmutex->mutex);
return CC_OK;
} /* cc_rwmutex_read_unlock() */
/* ********************************************************************** */
/*!
\class SbRWMutex Inventor/threads/SbRWMutex.h
\ingroup threads
The SbRWMutex is a mutex that is used to grant both read and write access
to the data it protects. Multiple threads can have read locks on the data
at once, but only one write-lock can be given out and not while a thread
has a read lock on the data.
The policy on granting read locks to threads when a thread is waiting for
the write lock is something that should be configurable at construction
time but which isn't at the moment.
*/
/*!
\fn SbRWMutex::SbRWMutex(Precedence policy)
Constructor.
*/
/*!
\fn SbRWMutex::~SbRWMutex(void)
Destructor.
*/
/*!
\fn int SbRWMutex::writeLock(void)
This method blocks the calling thread until it gains write lock status
on the SbRWMutex object.
*/
/*!
\fn SbBool SbRWMutex::tryWriteLock(void)
This method tries to gain write lock status on the SbRWMutex. TRUE is
returned if it was successful, FALSE otherwise. This is a non-blocking
operation.
*/
/*!
\fn int SbRWMutex::writeUnlock(void)
This method is used for unlocking the calling thread's write lock.
*/
/*!
\fn int SbRWMutex::readLock(void)
This method blocks the calling thread until it gains read lock status
on the SbRWMutex object.
*/
/*!
\fn SbBool SbRWMutex::tryReadLock(void)
This method tries to gain read lock status on the SbRWMutex. TRUE is
returned if it was successful, FALSE otherwise. This is a non-blocking
operation.
*/
/*!
\fn int SbRWMutex::readUnlock(void)
This method is used for unlocking the calling thread's read lock.
*/
/* ********************************************************************** */
| 24.862745 | 83 | 0.647702 | [
"object",
"3d"
] |
c40c7d3c4769afe642e64d075c82ed60897b35ce | 276 | cpp | C++ | leetcode_archived_cpp/LeetCode_324.cpp | Sean10/Algorithm_code | 46ff1cb5b81400cbcc324dabdf4298bf7a55e5eb | [
"BSD-3-Clause"
] | null | null | null | leetcode_archived_cpp/LeetCode_324.cpp | Sean10/Algorithm_code | 46ff1cb5b81400cbcc324dabdf4298bf7a55e5eb | [
"BSD-3-Clause"
] | 7 | 2021-03-19T04:41:21.000Z | 2021-10-19T15:46:36.000Z | leetcode_archived_cpp/LeetCode_324.cpp | Sean10/Algorithm_code | 46ff1cb5b81400cbcc324dabdf4298bf7a55e5eb | [
"BSD-3-Clause"
] | null | null | null | class Solution {
public:
void wiggleSort(vector<int>& nums) {
vector<int> s(nums);
sort(s.begin(), s.end());
for(int i = 0, j = (nums.size()+1)/2, k = nums.size()-1;k >= 0;k--)
{
nums[k] = s[k&1 ? j++ : i++];
}
}
};
| 23 | 75 | 0.42029 | [
"vector"
] |
c4122a3f899ef4a94109f78531249ccae85136fe | 5,255 | cc | C++ | ui/aura/mus/property_converter.cc | xzhan96/chromium.src | 1bd0cf3997f947746c0fc5406a2466e7b5f6159e | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2021-01-07T18:51:03.000Z | 2021-01-07T18:51:03.000Z | ui/aura/mus/property_converter.cc | emilio/chromium.src | 1bd0cf3997f947746c0fc5406a2466e7b5f6159e | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ui/aura/mus/property_converter.cc | emilio/chromium.src | 1bd0cf3997f947746c0fc5406a2466e7b5f6159e | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/aura/mus/property_converter.h"
#include "mojo/public/cpp/bindings/type_converter.h"
#include "services/ui/public/cpp/property_type_converters.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window_property.h"
namespace aura {
namespace {
// Get the WindowProperty's value as a byte array. Only supports aura properties
// that point to types with a matching std::vector<uint8_t> mojo::TypeConverter.
template <typename T>
std::unique_ptr<std::vector<uint8_t>> GetArray(Window* window,
const WindowProperty<T>* key) {
const T value = window->GetProperty(key);
if (!value)
return base::MakeUnique<std::vector<uint8_t>>();
return base::MakeUnique<std::vector<uint8_t>>(
mojo::ConvertTo<std::vector<uint8_t>>(*value));
}
} // namespace
PropertyConverter::PropertyConverter() {
// Add known aura properties with associated mus properties.
RegisterProperty(client::kAlwaysOnTopKey,
ui::mojom::WindowManager::kAlwaysOnTop_Property);
RegisterProperty(client::kAppIdKey,
ui::mojom::WindowManager::kAppID_Property);
RegisterProperty(client::kExcludeFromMruKey,
ui::mojom::WindowManager::kExcludeFromMru_Property);
RegisterProperty(client::kRestoreBoundsKey,
ui::mojom::WindowManager::kRestoreBounds_Property);
}
PropertyConverter::~PropertyConverter() {}
bool PropertyConverter::ConvertPropertyForTransport(
Window* window,
const void* key,
std::string* transport_name,
std::unique_ptr<std::vector<uint8_t>>* transport_value) {
*transport_name = GetTransportNameForPropertyKey(key);
if (transport_name->empty())
return false;
auto rect_key = static_cast<const WindowProperty<gfx::Rect*>*>(key);
if (rect_properties_.count(rect_key) > 0) {
*transport_value = GetArray(window, rect_key);
return true;
}
auto string_key = static_cast<const WindowProperty<std::string*>*>(key);
if (string_properties_.count(string_key) > 0) {
*transport_value = GetArray(window, string_key);
return true;
}
// Handle primitive property types generically.
DCHECK_GT(primitive_properties_.count(key), 0u);
// TODO(msw): Using the int64_t accessor is wasteful for smaller types.
const int64_t value = window->GetPropertyInternal(key, 0);
*transport_value = base::MakeUnique<std::vector<uint8_t>>(
mojo::ConvertTo<std::vector<uint8_t>>(value));
return true;
}
std::string PropertyConverter::GetTransportNameForPropertyKey(const void* key) {
if (primitive_properties_.count(key) > 0)
return primitive_properties_[key].second;
auto rect_key = static_cast<const WindowProperty<gfx::Rect*>*>(key);
if (rect_properties_.count(rect_key) > 0)
return rect_properties_[rect_key];
auto string_key = static_cast<const WindowProperty<std::string*>*>(key);
if (string_properties_.count(string_key) > 0)
return string_properties_[string_key];
return std::string();
}
void PropertyConverter::SetPropertyFromTransportValue(
Window* window,
const std::string& transport_name,
const std::vector<uint8_t>* data) {
for (const auto& primitive_property : primitive_properties_) {
if (primitive_property.second.second == transport_name) {
// aura::Window only supports property types that fit in int64_t.
if (data->size() != 8u) {
DVLOG(2) << "Property size mismatch (int64_t): " << transport_name;
return;
}
const int64_t value = mojo::ConvertTo<int64_t>(*data);
// TODO(msw): Should aura::Window just store all properties by name?
window->SetPropertyInternal(primitive_property.first,
primitive_property.second.first, nullptr,
value, 0);
return;
}
}
for (const auto& rect_property : rect_properties_) {
if (rect_property.second == transport_name) {
if (data->size() != 16u) {
DVLOG(2) << "Property size mismatch (gfx::Rect): " << transport_name;
return;
}
const gfx::Rect value = mojo::ConvertTo<gfx::Rect>(*data);
window->SetProperty(rect_property.first, new gfx::Rect(value));
return;
}
}
for (const auto& string_property : string_properties_) {
if (string_property.second == transport_name) {
// TODO(msw): Validate the data somehow, before trying to convert?
const std::string value = mojo::ConvertTo<std::string>(*data);
window->SetProperty(string_property.first, new std::string(value));
return;
}
}
DVLOG(2) << "Unknown mus property name: " << transport_name;
}
void PropertyConverter::RegisterProperty(
const WindowProperty<gfx::Rect*>* property,
const char* transport_name) {
rect_properties_[property] = transport_name;
}
void PropertyConverter::RegisterProperty(
const WindowProperty<std::string*>* property,
const char* transport_name) {
string_properties_[property] = transport_name;
}
} // namespace aura
| 35.748299 | 80 | 0.694957 | [
"vector"
] |
c412782322ab1ca7a997dbe9f35a3ecec66f2d71 | 931 | hpp | C++ | include/model.hpp | akitsu-sanae/phylan | bf949de7b5a91dfd965c3fcc4868b76b4b577375 | [
"BSL-1.0"
] | null | null | null | include/model.hpp | akitsu-sanae/phylan | bf949de7b5a91dfd965c3fcc4868b76b4b577375 | [
"BSL-1.0"
] | null | null | null | include/model.hpp | akitsu-sanae/phylan | bf949de7b5a91dfd965c3fcc4868b76b4b577375 | [
"BSL-1.0"
] | null | null | null | /*============================================================================
Copyright (C) 2016 akitsu sanae
https://github.com/akitsu-sanae/phylan
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
============================================================================*/
#ifndef PHYLAN_MODEL_HPP
#define PHYLAN_MODEL_HPP
#include <memory>
#include <vector>
namespace ph {
struct World;
struct Element;
struct Rope;
struct Model {
explicit Model(World&, std::istream&);
~Model();
void draw() const;
void save() const;
enum class Move {
Next,
Prev,
Parent
};
void move(Move);
void edit();
int eval() const;
private:
World& m_world;
std::unique_ptr<Element> m_ast;
std::vector<std::shared_ptr<Rope>> m_ropes;
Element* m_selected_element;
};
}
#endif
| 19.808511 | 78 | 0.556391 | [
"vector",
"model"
] |
c4189ffdc9d98653d67ab44345282174f72a1977 | 63,471 | cpp | C++ | WRK-V1.2/clr/src/jit64/peverify/readerir.cpp | intj-t/openvmsft | 0d17fbce8607ab2b880be976c2e86d8cfc3e83bb | [
"Intel"
] | null | null | null | WRK-V1.2/clr/src/jit64/peverify/readerir.cpp | intj-t/openvmsft | 0d17fbce8607ab2b880be976c2e86d8cfc3e83bb | [
"Intel"
] | null | null | null | WRK-V1.2/clr/src/jit64/peverify/readerir.cpp | intj-t/openvmsft | 0d17fbce8607ab2b880be976c2e86d8cfc3e83bb | [
"Intel"
] | null | null | null | // ==++==
//
//
// Copyright (c) 2006 Microsoft Corporation. All rights reserved.
//
// The use and distribution terms for this software are contained in the file
// named license.txt, which can be found in the root of this distribution.
// By using this software in any fashion, you are agreeing to be bound by the
// terms of this license.
//
// You must not remove this notice, or any other, from this software.
//
//
// ==--==
//
// readerir.cpp
//
// Empty implementation of required client methods.
//
#include "reader.h"
#include "readerir.h"
#include "utilcode.h"
#include "jit.h"
#ifndef NDEBUG
#define ASSERT(p) do { if (!(p)) {ReaderBase::GenIR_DebugError(__FILE__,__LINE__,#p);}} while (0)
#else
#define ASSERT(p)
#endif
/* DBPRINT/PRINT - */
static int _cdecl
dbprint_help(const char *form, va_list argptr)
{
int num = 0;
num = vfprintf(stdout, form, argptr);
return num;
}
int _cdecl dbprint(const char *form, ...)
{
va_list argptr;
va_start(argptr, form);
return dbprint_help(form, argptr);
}
// /////////////////////////////////////////////////////////////
// READER STACK
// /////////////////////////////////////////////////////////////
GenStack::GenStack(){
top = NULL;
}
IRNode* GenStack::pop(void) {
return NULL;
}
IRNode*
GenStack::getIterator(ReaderStackIterator** iterator) {
return NULL;
}
IRNode*
GenStack::iteratorGetNext(ReaderStackIterator** iterator) {
return NULL;
}
void
GenStack::iteratorReplace(ReaderStackIterator ** iterator, IRNode *node)
{
return;
}
IRNode*
GenStack::getReverseIterator(ReaderStackIterator**)
{
return NULL;
}
IRNode*
GenStack::getReverseIteratorFromDepth(ReaderStackIterator**, int depth)
{
return NULL;
}
IRNode*
GenStack::reverseIteratorGetNext(ReaderStackIterator**)
{
return NULL;
}
void
GenStack::push(IRNode* newVal, IRNode **newIR) {
ASSERT(newVal == NULL);
return;
}
void
GenStack::clearStack(void) {
top = NULL;
}
bool
GenStack::empty(void) {
return (top == NULL);
}
void
GenStack::assertEmpty(void) {
//ASSERT(top==NULL);
}
int
GenStack::depth(void) {
return 0;
}
#if !defined(NODEBUG)
void GenStack::print(void) { }
#endif
ReaderStack*
GenStack::copy(void) {
return this;
}
ReaderStack*
GenIR::GenIR_CreateStack(int maxStack, ReaderBase * gen)
{
void *buf = gen->getProcMemory(sizeof(GenStack));
return new (buf) GenStack;
}
void
GenIR::GenIR_MethodNeedsSecurityCheck(){}
void
GenIR::GenIR_SetOptimizedCastUsed(){}
IRNode *
GenIR::GenIR_InsertIBCAnnotation(FlowGraphNode *fgnode, unsigned int count, unsigned int offset)
{
return NULL;
}
void
GenIR::GenIR_InsertIBCAnnotations()
{
}
void
GenIR::GenIR_MethodNeedsToKeepAliveGenericsContext(bool keepGenericsCtxtAlive){}
void
GenIR::GenIR_ReaderPrePass(
BYTE* pBuf,
unsigned int numBytes
){
int numAutos, numParams;
CORINFO_SIG_INFO sig;
#ifndef NDEBUG
if (getenv("PEV_FNAME"))
{
const char *modname;
const char *methodname = getCurrentMethodName( &modname );
printf("%s::%s\n", modname, methodname);
}
#endif
// Client specific initialization
m_headBlock = (FlowGraphNode*)getProcMemory(sizeof(FlowGraphNode));
m_tailBlock = (FlowGraphNode*)getProcMemory(sizeof(FlowGraphNode));
m_headBlock->succList = m_headBlock->predList = NULL;
m_tailBlock->succList = m_tailBlock->predList = NULL;
m_headBlock->next = m_tailBlock;
m_tailBlock->next = NULL;
m_entryLabel = GenIR_MakeLabel(0, NULL);
m_exitLabel = GenIR_MakeLabel(numBytes, NULL);
m_headBlock->startNode = (IRNode*)getProcMemory(sizeof(IRNode));
m_headBlock->startNode->kind = IR_block;
m_headBlock->startNode->fgNode = m_headBlock;
m_headBlock->startNode->isFallThrough = true;
m_headBlock->startNode->prev = NULL;
m_headBlock->startNode->msilOffset = 0;
m_headBlock->startOffset = 0;
m_headBlock->endOffset = numBytes;
m_headBlock->startNode->next = m_entryLabel;
m_entryLabel->prev = m_headBlock->startNode;
m_tailBlock->startNode = (IRNode*)getProcMemory(sizeof(IRNode));
m_tailBlock->startNode->kind = IR_block;
m_tailBlock->startNode->fgNode = m_tailBlock;
m_tailBlock->startNode->isFallThrough = true;
m_tailBlock->startNode->prev = m_entryLabel;
m_tailBlock->startNode->next = m_exitLabel;
m_tailBlock->startNode->msilOffset = numBytes;
m_tailBlock->startOffset = numBytes;
m_tailBlock->endOffset = numBytes;
m_exitLabel->prev = m_tailBlock->startNode;
m_exitLabel->next = NULL;
m_entryLabel->next = m_tailBlock->startNode;
numAutos = m_jitContext->methodInfo->locals.numArgs;
m_jitContext->jitInfo->getMethodSig(m_jitContext->methodInfo->ftn, &sig);
numParams = (int)sig.totalILArgs();
// totalILArgs does *not* include the hidden cookie param passed to varargs functions.
if (sig.isVarArg())
{
numParams++;
}
initVerifyInfo();
initParamsAndAutos(numParams, numAutos);
return;
}
#ifndef NDEBUG
void PrintRegionKind(ReaderBaseNS::RegionKind kind)
{
char *typeName;
printf("regionType = ");
switch(kind)
{
case ReaderBaseNS::RGN_UNKNOWN:
typeName="RGN_UNKNOWN"; break;
case ReaderBaseNS::RGN_NONE:
typeName="RGN_NONE"; break;
case ReaderBaseNS::RGN_ROOT:
typeName="RGN_ROOT"; break;
case ReaderBaseNS::RGN_TRY:
typeName="RGN_TRY"; break;
case ReaderBaseNS::RGN_EXCEPT:
typeName="RGN_EXCEPT"; break;
case ReaderBaseNS::RGN_FAULT:
typeName="RGN_FAULT"; break;
case ReaderBaseNS::RGN_FINALLY:
typeName="RGN_FINALLY"; break;
case ReaderBaseNS::RGN_FILTER:
typeName="RGN_FILTER"; break;
case ReaderBaseNS::RGN_DTOR:
typeName="RGN_DTOR"; break;
case ReaderBaseNS::RGN_CATCH:
typeName="RGN_CATCH"; break;
case ReaderBaseNS::RGN_MEXCEPT:
typeName="RGN_MEXCEPT"; break;
case ReaderBaseNS::RGN_MCATCH:
typeName="RGN_MCATCH"; break;
case ReaderBaseNS::RGN_CLAUSE_NONE:
typeName="RGN_CLAUSE_NONE"; break;
case ReaderBaseNS::RGN_CLAUSE_FILTER:
typeName="RGN_CLAUSE_FILTER"; break;
case ReaderBaseNS::RGN_CLAUSE_FINALLY:
typeName="RGN_CLAUSE_FINALLY"; break;
case ReaderBaseNS::RGN_CLAUSE_ERROR:
typeName="RGN_CLAUSE_ERROR"; break;
case ReaderBaseNS::RGN_CLAUSE_FAULT:
typeName="RGN_CLAUSE_FAULT"; break;
default:
typeName="<error>";
}
printf("%s ", typeName);
}
void PrintIRNode(IRNode *node, int indent=4)
{
char *type;
while (indent--)
printf(" ");
switch (node->kind)
{
case IR_label:
type = "label";
break;
case IR_branch:
type = "branch";
break;
case IR_ehFlow:
type = "ehflow";
break;
case IR_ehStart:
type = "ehstart";
break;
case IR_ehEnd:
type = "ehend";
break;
case IR_throw_rethrow:
type = "throw or rethrow";
break;
case IR_switch:
type = "switch";
break;
case IR_jmp:
type = "jmp";
break;
case IR_endfinally:
type = "endfinally";
break;
case IR_block:
type = "block";
break;
default:
type = "INVALID";
break;
}
printf("0x%x: %s %s ", node->msilOffset, type, node->isFallThrough ? "":"no fallthru");
if (node->fgNode)
{
printf("fgNode:%p ", node->fgNode);
}
if (node->kind == IR_label)
{
BranchList *bl = node->branchList;
printf("branches( ");
while (bl)
{
printf("%x ", bl->branch->msilOffset);
bl = bl->next;
}
printf(" )");
}
if (node->kind == IR_ehStart || node->kind == IR_ehEnd)
{
PrintRegionKind(node->regionKind);
}
printf("\n");
if (node->next)
{
if (node->next->prev != node)
printf("BAD BAD BAD\n");
}
}
void PrintFgNode(FlowGraphNode *node, bool printIr=false)
{
printf("FGnode [%x:%x] %s %s ptr=%p\n", node->startOffset, node->endOffset,
node->isVisited?"visited":"", node->isSizeZero?"zero size":"", node);
IRNode *ir = node->startNode;
while (ir && printIr)
{
PrintIRNode(ir);
ir=ir->next;
if (ir && ir->kind == IR_block)
break;
}
}
void PrintEdge(FlowGraphEdgeList *edge)
{
if (edge->isNominal)
printf("(nominal)");
if (edge->isEndFinally)
printf("(end finally)");
if (edge->isDeletedEdge)
printf("(deleted)");
printf(" ");
PrintFgNode(edge->block, false);
}
void PrintAllIR(FlowGraphNode *headBlock)
{
FlowGraphNode *node = headBlock;
FlowGraphEdgeList *edges;
while (node)
{
PrintFgNode(node, true);
edges = node->succList;
while (edges)
{
printf(" successor ");
PrintEdge(edges);
edges = edges->next;
}
edges = node->predList;
while (edges)
{
printf(" predecessor ");
PrintEdge(edges);
edges = edges->next;
}
node = node->next;
}
}
#endif
// Called between building the flow graph and inserting the IR
void
GenIR::GenIR_ReaderMiddlePass(void)
{
// no-op
#ifndef NDEBUG
if (getenv("PEV_DUMPIR"))
{
PrintAllIR(m_headBlock);
}
#endif
return;
}
void
GenIR::GenIR_ReaderPostPass(
bool fImportOnly
){
// Cleanup from GenIR - free any dynamic memory we used
}
// Hook to notify client that we are beginning the processing of a new block.
void
GenIR::GenIR_BeginFlowGraphNode(
FlowGraphNode* fg,
unsigned int currOffset,
bool isVerifyOnlye
){
m_currentFgNode = fg;
}
void
GenIR::GenIR_EndFlowGraphNode(
FlowGraphNode* fg,
unsigned int currOffset,
IRNode **newIR
){
}
GenIR::~GenIR()
{
void **next;
void **current = m_peverifyAllocList;
while (current)
{
next = (void **) *current;
delete current;
current = next;
}
}
// Get memory that will die at end of reader.
// we thread together all the allocations via the first pointer-sized chunk of
// each allocation so we can go through and delete them at the end. Not the most
// efficient scheme but it is simple.
void *
GenIR::getTempMemory(
unsigned bytes
){
// add one pointer for our bookkeeping
bytes += sizeof(void*);
// to round up
bytes += sizeof(void*) - 1;
// want this pointer-aligned
void **mem = new void*[bytes / sizeof(void*)];
memset(mem, 0, bytes / sizeof(void*) * sizeof(void*));
// first pointer-sized chunk is for our bookkeeping
*mem = m_peverifyAllocList;
m_peverifyAllocList = mem;
return mem+1;
}
// Get memory that will persist after the reader
// Real jit would use pools.
void *
GenIR::getProcMemory(
unsigned bytes
){
return getTempMemory(bytes);
}
EHRegion*
GenIR::RgnAllocateRegion(void)
{
return (EHRegion*)getProcMemory(sizeof(EHRegion));
}
EHRegionList*
GenIR::RgnAllocateRegionList(void)
{
return (EHRegionList*)getProcMemory(sizeof(EHRegionList));
}
// Build IRNode to represent Exception Object, to be pushed
// onto (empty) operand stack when processing start of funclet.
IRNode*
GenIR::GenIR_MakeExceptionObject(
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_UnaryOp(
ReaderBaseNS::UnaryOpcode opcode,
IRNode* arg1,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_BinaryOp(
ReaderBaseNS::BinaryOpcode opcode,
IRNode* arg1,
IRNode* arg2,
IRNode** newIR
){
return NULL;
}
void
GenIR::GenIR_Nop(IRNode **newIR)
{
return;
}
bool
GenIR::GenIR_Abs(
IRNode* arg1,
IRNode** retVal,
IRNode** newIR
){
return false;
}
//
// GenIR_ArgList -
//
IRNode*
GenIR::GenIR_ArgList(
IRNode** newIR
){
return NULL;
}
//
// GenIR_InstParam -
//
IRNode*
GenIR::GenIR_InstParam(
IRNode** newIR
){
return NULL;
}
//
// GenIR_ThisObj -
//
IRNode*
GenIR::GenIR_ThisObj(
IRNode** newIR
){
return NULL;
}
// GenIR_Branch -
void
GenIR::GenIR_Branch(
IRNode** newIR
){
return;
}
void
GenIR::GenIR_BoolBranch(
ReaderBaseNS::BoolBranchOpcode opcode,
IRNode *arg1,
IRNode **newIR
){
return;
}
// GenIR_CondBranch - Create instruction tuples to compare the top two operands
// on the stack and do a conditional branch.
void
GenIR::GenIR_CondBranch(
ReaderBaseNS::CondBranchOpcode opcode,
IRNode* arg1,
IRNode* arg2,
IRNode** newIR
)
{
return;
}
// Leave target block will be lone successor block.
void
GenIR::GenIR_Leave(
unsigned int targetOffset,
bool isNonLocal,
bool endsWithNonLocalGoto,
IRNode **newIR
){
return;
}
bool
GenIR::GenIR_Sqrt(
IRNode *arg1,
IRNode **retVal,
IRNode **newIR
){
return false;
}
// Switch is passed an target count,
// and an array of the destination blocks.
void
GenIR::GenIR_Switch(
IRNode *opr,
IRNode **newIR
){
}
void
GenIR::GenIR_Rethrow(
IRNode** newIR
){
}
// Throw node was already created during fg build, now append src onto throw.
void
GenIR::GenIR_Throw(
IRNode * arg1,
IRNode** newIR
){
}
// GenIR_EndFilter - Generate a src, no dst, except tuple
void
GenIR::GenIR_EndFilter(
IRNode* arg1,
IRNode** newIR
){
}
// Function: GenIR_Return
//
// Creates a return instruction tuple if there is anything on the stack.
//
// If the method is synchronized, then we must insert a call to
// monitor_exit before returning. The call to monitor_exit must occur
// after the return value has been calculated, so, if the return type
// is not void, assign the return value into a tmpvar, call mon_exit,
// then return the tmpvar.
void
GenIR::GenIR_Return(
IRNode* opr,
bool synchronousMethod,
bool needsByrefReturnCheck,
IRNode** newIR
){
return;
}
// GenIR_CkFinite - Places on overflow check on the floating point operand
// sitting on top of the stack.
IRNode*
GenIR::GenIR_CkFinite(
IRNode* opr,
IRNode** newIR
){
return NULL;
}
// GenIR_Cmp - This function creates the tuples needed to implement the MSIL instructions
// CEQ, CGT, CLT, CGT_UN, CLT_UN. This five instructions take two argruments and
// return either 1 or 0 (int32): 1 for the comparison being true and 0 for false.
// There are two obvious ways to implement this. Previously this was impemented
// with an if/then/else structure. It can also be implemented easily using the question
// operator. The question operator was ported over from UTC for this explicit purpose.
// As noted in loQuestion, the behavior of the OPQUESTION is indetermainent if used
// for anything besides this purpose.
IRNode* GenIR::GenIR_Cmp(
ReaderBaseNS::CmpOpcode opcode,
IRNode* arg1,
IRNode* arg2,
IRNode** newIR
)
{
return NULL;
}
IRNode*
GenIR::GenIR_Conv(
ReaderBaseNS::ConvOpcode opcode,
IRNode* arg1,
IRNode** newIR
){
return NULL;
}
// Accepts IRNode* opr which is operand to be duplicated.
// Returns IRNode* which is duplicate operand to be
// pushed onto stack.
void
GenIR::GenIR_Dup(
IRNode* opr,
IRNode** result1,
IRNode** result2,
IRNode** newIR
){
*result1 = NULL;
*result2 = NULL;
return;
}
IRNode*
GenIR::GenIR_LoadLen(
IRNode* arg1,
IRNode** newIR
){
return NULL;
}
bool
GenIR::GenIR_ArrayAddress(
CORINFO_SIG_INFO *sig,
IRNode **retVal,
IRNode **newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_LoadStringLen(
IRNode* addr,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_StringGetChar(
IRNode* addr,
IRNode* index,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_ArrayGetDimLength(
IRNode *arg1,
IRNode *arg2,
CORINFO_CALL_INFO *callInfo,
IRNode **newIR
)
{
return NULL;
}
IRNode*
GenIR::GenIR_RuntimeLookupToNode(
CORINFO_RUNTIME_LOOKUP_KIND kind,
CORINFO_RUNTIME_LOOKUP *pRuntimeLookup,
IRNode **newIR
){
return NULL;
}
bool
GenIR::GenIR_ArrayGet(
CORINFO_SIG_INFO *sig,
IRNode **retVal,
IRNode **newIR
)
{
return false;
}
bool
GenIR::GenIR_ArraySet(
CORINFO_SIG_INFO *sig,
IRNode **newIR
)
{
return false;
}
IRNode*
GenIR::GenIR_GenericTokenToNode(
mdToken token,
IRNode **newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_GetStaticFieldAddress(
mdToken tokenField,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_LoadArg(
unsigned int argOrdinal,
bool isJmp,
IRNode **newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_LoadStaticField(
mdToken token,
bool fVolatile,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_LoadVirtFunc(
IRNode* arg1,
mdToken token,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_LocalAlloc(
IRNode* arg1,
bool zeroInit,
IRNode** newIR
){
return NULL;
}
/* KMTF: VOS Opcodes un-needed here?
IRNode*
GenIR::GenIR_GetStaticFieldAddress(
mdToken token,
IRNode** newIR
){
return NULL;
}
*/
IRNode*
GenIR::GenIR_GetFieldAddress(
mdToken token,
IRNode* ptObj,
bool fObjIsThis,
bool* fNullCheckAdded,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_LoadFieldAddress(
mdToken token,
IRNode* ptObj,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_LoadField(
mdToken token,
IRNode* ptObj,
ReaderAlignType alignmentPrefix,
bool fVolatilePrefix,
IRNode** newIR
){
return NULL;
}
void
GenIR::GenIR_StoreField(
mdToken token,
IRNode* ptValue,
IRNode* ptObj,
ReaderAlignType alignment,
bool fVolatile,
IRNode** newIR
){
return;
}
void
GenIR::GenIR_StoreObj(
mdToken token,
IRNode* value,
IRNode* addr,
ReaderAlignType alignment,
bool fVolatile,
bool fField,
IRNode** newIR
){
return;
}
void
GenIR::GenIR_StoreIndir(
ReaderBaseNS::StIndirOpcode opcode,
IRNode* value,
IRNode* address,
ReaderAlignType alignment,
bool fVolatile,
IRNode** newIR
){
return;
}
void
GenIR::GenIR_StorePrimitiveType(
IRNode* value,
IRNode* addr,
CorInfoType corInfoType,
ReaderAlignType alignment,
bool fVolatile,
IRNode** newIR
){
return;
}
IRNode*
GenIR::GenIR_LoadPrimitiveType(
IRNode* addr,
CorInfoType corInfoType,
ReaderAlignType alignment,
bool fVolatile,
bool fInterfReadOnly,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_LoadNonPrimitiveObj(
IRNode* addr,
CORINFO_CLASS_HANDLE classHandle,
ReaderAlignType alignment,
bool fVolatile,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_LoadLocal(
unsigned int localOrdinal,
IRNode **newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_LoadArgAddress(
unsigned int argOrdinal,
IRNode **newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_LoadLocalAddress(
unsigned int argOrdinal,
IRNode **newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_LoadConstantI(
size_t constant,
IRNode **newIR)
{
return NULL;
}
IRNode*
GenIR::GenIR_LoadConstantI4(
int constant,
IRNode** newIR)
{
return NULL;
}
IRNode*
GenIR::GenIR_LoadConstantI8(
__int64 constant,
IRNode** newIR)
{
return NULL;
}
IRNode*
GenIR::GenIR_LoadConstantR4(
float constant,
IRNode** newIR)
{
return NULL;
}
IRNode*
GenIR::GenIR_LoadConstantR8(
double constant,
IRNode** newIR)
{
return NULL;
}
IRNode*
GenIR::GenIR_LoadFuncptr(
mdToken token,
CORINFO_LOOKUP *pLookup,
IRNode** newIR
){
return NULL;
}
// GenIR_LoadNull - returns null ptr reference.
IRNode*
GenIR::GenIR_LoadNull(
IRNode **newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_NewArr(
mdToken token,
IRNode* arg1,
IRNode** newIR
){
return NULL;
}
void
GenIR::GenIR_Pop(
IRNode *opr,
IRNode **newIR
){
}
IRNode*
GenIR::GenIR_Shift(
ReaderBaseNS::ShiftOpcode opcode,
IRNode* shift,
IRNode* opr,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_Sizeof(
mdToken token,
IRNode **newIR
){
return NULL;
}
void
GenIR::GenIR_StoreElem(
ReaderBaseNS::StElemOpcode opcode,
mdToken token,
IRNode *arg1,
IRNode *arg2,
IRNode *arg3,
IRNode **newIR
){
return;
}
void
GenIR::GenIR_StoreStaticField(
mdToken token,
IRNode* ptValue,
bool fIsVolatile,
IRNode** newIR
){
return;
}
void
GenIR::GenIR_StoreArg(
unsigned int ordinal,
IRNode* addr,
ReaderAlignType alignment,
bool fVolatile,
IRNode** newIR
){
return;
}
void
GenIR::GenIR_StoreLocal(
unsigned int ordinal,
IRNode* addr,
ReaderAlignType alignment,
bool fVolatile,
IRNode** newIR
){
return;
}
IRNode*
GenIR::GenIR_LoadElem(
ReaderBaseNS::LdElemOpcode opcode,
mdToken token,
IRNode *arg1,
IRNode *arg2,
IRNode **newIR
){
return NULL;
}
// GenIR_LoadElemA - Generate the address of an array element specified
// on the stack by an index and an address. The size of the array elements
// comes from a class token which gives the types of the elements.
IRNode*
GenIR::GenIR_LoadElemA(
mdToken token,
IRNode *ptIndex,
IRNode *ptObj,
bool fReadOnlyPrefix,
IRNode **newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_RefAnyType(
IRNode* arg1,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_MakeRefAny(
mdToken token,
IRNode* object,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_NewObj(
mdToken token,
mdToken loadFtnToken,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_Call(
ReaderBaseNS::CallOpcode opcode,
mdToken token,
mdToken constraintTypeRef,
bool readOnlyPrefix,
bool tailCallPrefix,
bool isUnmarkedTailCall,
IRNode** newIR
){
return NULL;
}
// Method is called with empty stack
void
GenIR::GenIR_Jmp(
ReaderBaseNS::CallOpcode opcode,
mdToken token,
bool hasThis,
bool hasVarArg,
IRNode** newIR
){
return;
}
IRNode*
GenIR::GenIR_GetHelperCallAddress(
CorInfoHelpFunc helperId,
IRNode** newIR
){
return NULL;
}
// ---------------------------------------------------------------------
// VERIFICATION - client methods required for verification.
// ---------------------------------------------------------------------
void
GenIR::GenIR_ClearCurrentBlock(
IRNode** newIR
){
return ;
}
void
GenIR::GenIR_FgDeleteNodesFromBlock(
FlowGraphNode* block
){
return;
}
// Common code uses GenIR_CreateSym to notify client of autos and params.
void
GenIR::GenIR_CreateSym(
int localNum,
bool isAuto, // auto or param
CorInfoType corType,
CORINFO_CLASS_HANDLE hClass,
bool fIsPinned,
ReaderSpecialSymbolType type /* optional */
){
return;
}
// Given operand from stack, produce a new IRNode of legal,
// msil stack type (eg float64, int32 or int64). For example,
// if passed a node with type unsigned char, this function returns
// a node of type int32.
IRNode*
ReaderBase::GenIR_MakeStackTypeNode(
IRNode* node
){
return NULL;
}
// When operands are live on the operand stack at a block
// boundary then new operand stacks are created to represent
// the live values incoming to the successor blocks. The
// implementation is earlier asked to create nodes for the
// operand stack copies, and this routine is called to generate
// copies to the new nodes.
//
// Note that depending on the nodes that are used by the
// implementation, an implementation might not need to perform
// copies at this point.
void
GenIR::GenIR_AssignToSuccessorStackNode(
FlowGraphNode* fg,
IRNode* dst,
IRNode* src,
IRNode** newIR,
bool* fmbassign
){
return;
}
void
ReaderBase::GenIR_DebugError(
const char* filename,
unsigned linenumber,
const char* s
){
#if !defined(NDEBUG)
if(s) dbprint("%s, line %d: %s\n",filename, linenumber, s);
RaiseException(JIT64_FATALEXCEPTION_CODE, EXCEPTION_NONCONTINUABLE, 0, NULL);
#endif
}
// Fatal error, reader cannot continue.
void
ReaderBase::GenIR_Fatal(
int errNum
){
/*#if !defined(NODEBUG)
if(msg)
dbprint("%s\n",msg);
#endif*/
RaiseException(JIT64_FATALEXCEPTION_CODE, 0, 0, NULL);
}
/* KMTF: This has been removed from the interface!
// GenIR_CopyStackList - Returns the duplicate of a stack's list, but
// doesn't copy the container.
ReaderStackNode*
GenIR::GenIR_CopyStackList(
ReaderStackNode* stackNode
){
return NULL;
}
*/
// Routine called when blocks end with a non-empty operand stack. Routine
// must call handleNonEmptyStack. Opr1 and Opr2 are non-null if block end
// instruction was branch with 1 or 2 operands.
void
GenIR::GenIR_MaintainOperandStack(
IRNode** opr1,
IRNode** opr2,
IRNode** newIR
){
bool fmbassign;
handleNonEmptyStack(m_currentFgNode,
newIR,
&fmbassign);
}
// -------------------------------------------------------------------
// Reader Entry
// -------------------------------------------------------------------
int
ReadMSIL(JitContext* jitContext,
BYTE ** entryAddress,
unsigned * codeSize
){
// not supposed to get here
return 0;
}
// ----------------------------------------------------------------------
// Everything after this point is unused in nop jit.
// ----------------------------------------------------------------------
//
// VOS support routines that must be implemented by client if VOS routines
// will be used.
//
#define REACHED_UNIMPLEMENTED_ROUTINE //(ASSERTM(UNREACHED,"ERROR - reached unimplemented routine"))
IRNode*
GenIR::GenIR_CallHelper(
CorInfoHelpFunc helperID,
IRNode* dst,
IRNode** newIR,
IRNode* arg1, /*optional*/
IRNode* arg2, /*optional*/
IRNode* arg3, /*optional*/
ReaderAlignType alignment, /*optional*/
bool fVolaltile, /*optional*/
bool fNoCtor,
bool fCanMoveUp
){
return NULL;
}
// Special generics helper
IRNode *
GenIR::GenIR_CallRuntimeHandleHelper(CorInfoHelpFunc helper,
IRNode* arg1, IRNode* arg2,
IRNode* arg3,IRNode* arg4,IRNode* arg5,
IRNode* nullCheckArg, IRNode** newIR)
{
REACHED_UNIMPLEMENTED_ROUTINE;
return NULL;
}
IRNode*
ReaderBase::GenIR_GetHelperCallAddress(
CorInfoHelpFunc helperId,
IRNode** newIR
){
return NULL;
}
IRNode*
ReaderBase::GenIR_MakePtrDstGCOperand(
bool isInterior
){
return NULL;
}
IRNode*
GenIR::GenIR_AddressOfLeaf(
IRNode* leaf,
IRNode** newIR
){
REACHED_UNIMPLEMENTED_ROUTINE;
return NULL;
}
IRNode*
GenIR::GenIR_AddressOfValue(
IRNode* leaf,
IRNode** newIR
){
return NULL;
}
IRNode*
GenIR::GenIR_ConvertToHelperArgumentType(
IRNode* opr,
unsigned int destinationSize,
IRNode** newIR
){
return NULL;
}
IRNode*
ReaderBase::GenIR_DerefAddress(
IRNode* addr,
bool isGc,
IRNode** newIR
){
return NULL;
}
IRNode*
ReaderBase::GenIR_MakePtrNode(
ReaderPtrType ptrType /* [default param] = READER_PTR_NOT_GC */
){
REACHED_UNIMPLEMENTED_ROUTINE;
return NULL;
}
IRNode*
GenIR::GenIR_MakeCallReturnNode(
CORINFO_SIG_INFO *pSig,
unsigned *hiddenMBParamSize,
PGCLAYOUT_STRUCT *ppGcLayoutStruct
){
REACHED_UNIMPLEMENTED_ROUTINE;
return NULL;
}
IRNode*
GenIR::GenIR_GenNullCheck(
IRNode* tupAddr,
IRNode** newIR
){
REACHED_UNIMPLEMENTED_ROUTINE;
return NULL;
}
void
GenIR::GenIR_DisableGC(
IRNode* threadControlBlock,
IRNode** newIR
){
REACHED_UNIMPLEMENTED_ROUTINE;
return;
}
void
GenIR::GenIR_EnableGC(
IRNode* threadControlBlock,
IRNode** newIR
){
REACHED_UNIMPLEMENTED_ROUTINE;
return;
}
IRNode*
GenIR::GenIR_GenCall(ReaderCallTargetData *callTargetInfo,
callArgTriple* argArray, unsigned int numArgs,
IRNode** callNode, IRNode** newIR
){
REACHED_UNIMPLEMENTED_ROUTINE;
return NULL;
}
void
GenIR::GenIR_OpcodeDebugPrint(BYTE *pbuf, unsigned startOffset, unsigned endOffset)
{
//printMSIL(pbuf,startOffset,endOffset);
return;
}
//
// Optional routines, default implementation is minimal. Client
// may wish to overload these.
//
// Client can overload to provide a way to force verification.
bool
GenIR::verForceVerification(
void
){
return true;
}
// removeInterference
//
// This function is necessary if the client will be placing aliasable
// references onto the operand stack. For example:
//
// ldloc_2
// ldc_1
// stloc_2
//
// The processing of ldloc_2 could produce a reference to local#2.
// stloc_2 causes a 1 to be stored to local#2. If a reference to local#2
// were kept on the stack across the store, the stack value would change,
// which is incorrect.
//
// Function is called when we are about to emit code for an instruction
// that could alias (overwrite) elements that are live on the stack.
// Traverse the operand stack and replace anything that can be aliased
// with a temp (and generate an assignment to that temp).
//
// If the client will never place references to aliasable values onto
// the operand stack then this function can be kept empty.
void GenIR::GenIR_RemoveStackInterference(
IRNode** storePoint
){
return;
}
void GenIR::GenIR_RemoveStackInterferenceForLocalStore(
unsigned int opcode,
unsigned int ordinal,
IRNode** storePoint
){
return;
}
//
bool
GenIR::GenIR_IsCall(
IRNode** newIR
){
return false;
}
bool GenIR::GenIR_IsRegionStartBlock(FlowGraphNode* fg)
{
IRNode *irTemp = fg->startNode->next;
bool fIsRegionStart = false;
while (irTemp && irTemp->kind != IR_block)
{
if (irTemp->kind == IR_ehStart)
{
fIsRegionStart = true;
break;
}
irTemp = irTemp->next;
}
return fIsRegionStart;
}
bool GenIR::GenIR_IsRegionEndBlock(FlowGraphNode* fg)
{
return GenIR_FgBlockIsRegionEnd(fg);
}
// Function is called with the lone null placeholder
// block. Function takes this empty root block before flow graph building
// and ensures that if there are already IRNodes in the block that they
// are split into an earlier block.
FlowGraphNode*
GenIR::GenIR_FgPrePhase(
FlowGraphNode *block
){
return block;
}
FlowGraphNode*
GenIR::GenIR_FgGetHeadBlock(void)
{
return m_headBlock;
}
FlowGraphNode*
GenIR::GenIR_FgGetTailBlock(void)
{
return m_tailBlock;
}
void
GenIR::GenIR_FgPostPhase(
void
){
// make a zero size entry block so we can wire all the unreachable
// code up to it
fgSplitBlock(m_headBlock, 0, m_headBlock->startNode->next);
}
#if !defined(NDEBUG)
DWORD
GenIR::GenIR_DBGetFuncHash(
void
){
return 0;
}
void
GenIR::GenIR_DBPrintEHRegion(EHRegion * region)
{
return;
}
void
GenIR::GenIR_DBPrintFGNode(FlowGraphNode * fgNode)
{
return;
}
void
GenIR::GenIR_DBPrintIRNode(IRNode * irNode)
{
PrintIRNode(irNode);
return;
}
void
GenIR::GenIR_DBDumpFunction(void)
{
return;
}
#endif //!defined(NDEBUG)
void GenIR::Itf_RegisterNumberOfIndirs(int numIndirs)
{
return;
}
void
GenIR::GenIR_SetSequencePoint(unsigned nLineNumber,ICorDebugInfo::SourceTypes, IRNode **newIR)
{
return;
}
bool
GenIR::GenIR_NeedSequencePoints()
{
return false;
}
void
GenIR::GenIR_SetEHInfo(EHRegion* ehRegionTree, EHRegionList* ehRegionList)
{
return;
}
IRNode*
GenIR::GenIR_DerefAddress(IRNode* address, bool fDstIsGCPtr, IRNode** newIR)
{
return NULL;
}
IRNode*
GenIR::GenIR_HandleToIRNode(mdToken token, void* embedHandle, void* realHandle, bool fIndirect, bool fReadOnly, bool fRelocatable, bool fCallTarget, IRNode** newIR, bool fIsFrozenObject)
{
return NULL;
}
IRNode*
GenIR::GenIR_MakePtrDstGCOperand( bool fInteriorGC)
{
return NULL;
}
IRNode*
GenIR::GenIR_MakePtrNode(ReaderPtrType ptrType /* [default param] = READER_PTR_NOT_GC */)
{
return NULL;
}
IRNode*
GenIR::GenIR_MakeStackTypeNode(IRNode* node)
{
return NULL;
}
// Hook to permit client to record call information
void
GenIR::GenIR_FgCall(ReaderBaseNS::OPCODE, mdToken token, unsigned msilOffset, IRNode* block, bool fCanInline)
{
}
bool
GenIR::GenIR_DisableCastClassOptimization()
{
// Peverify doesn't ever want this to happen -- it would
// just end up complicating the flow graph for no reason.
return true;
}
bool
GenIR::GenIR_DisableIsInstOptimization()
{
// Peverify doesn't ever want this to happen -- it would
// just end up complicating the flow graph for no reason.
return true;
}
// Given a block and offset, find the first node in the block that comes after the given offset, and
// insert the label before that node.
void GenIR::GenIR_InsertLabelInBlock(FlowGraphNode* block,
unsigned int offset,IRNode* newLabel)
{
IRNode* irTemp = block->startNode->next;
while ( irTemp->msilOffset < offset
&& irTemp->kind != IR_block)
{
irTemp = irTemp->next;
}
//ASSERTNR(irTemp->prev != NULL)
// irTemp is now the IRNode immediately after where we want to be inserted.
newLabel->prev = irTemp->prev;
irTemp->prev = newLabel;
newLabel->next = irTemp;
newLabel->prev->next = newLabel;
return;
}
IRNode* GenIR::GenIR_FindBlockSplitPointAfterNode(IRNode* node)
{
return node->next;
}
IRNode* GenIR::GenIR_ExitLabel(void)
{
return m_exitLabel;
}
IRNode* GenIR::GenIR_EntryLabel(void)
{
return m_entryLabel;
}
// Function is passed a try region, and is expected to return the first label or instruction
// after the region.
IRNode* GenIR::GenIR_FindTryRegionEndOfClauses(EHRegion* tryRegion)
{
return NULL;
}
void GenIR::GenIR_InsertEHAnnotationNode(IRNode* insertionPointNode,
IRNode* insertNode)
{
// Let's put insertNode after insertionPointNode;
insertNode->next = insertionPointNode->next;
insertionPointNode->next = insertNode;
insertNode->prev = insertionPointNode;
insertNode->next->prev = insertNode;
return;
}
IRNode* GenIR::GenIR_MakeLabel(unsigned int targetOffset, EHRegion* region)
{
IRNode *newIR = (IRNode*)getProcMemory(sizeof(IRNode));
newIR->kind = IR_label;
newIR->isFallThrough = true;
newIR->msilOffset = targetOffset;
newIR->region = region;
newIR->branchList = NULL;
return newIR;
}
void GenIR::GenIR_MarkAsEHLabel(IRNode* labelNode)
{
// no-op
return;
}
IRNode* GenIR::GenIR_MakeTryEndNode(void)
{
return GenIR_MakeRegionEndNode(ReaderBaseNS::RGN_TRY);
}
IRNode* GenIR::GenIR_MakeRegionStartNode(ReaderBaseNS::RegionKind regionType)
{
IRNode* newIR = (IRNode*)getProcMemory(sizeof(IRNode));
newIR->kind = IR_ehStart;
newIR->isFallThrough = true;
newIR->regionKind = regionType;
return newIR;
}
IRNode* GenIR::GenIR_MakeRegionEndNode(ReaderBaseNS::RegionKind regionType)
{
IRNode* newIR = (IRNode*)getProcMemory(sizeof(IRNode));
newIR->kind = IR_ehEnd;
newIR->isFallThrough = false;
newIR->regionKind = regionType;
return newIR;
}
// Flowgraph Routine Implementations
// Interface to GenIR defined Flow Graph structures.
// Implementation Supplied by Jit Client
FlowGraphNode* FgNodeGetNext(FlowGraphNode* fgNode)
{
return fgNode->next;
}
bool FgNodeIsVisited(FlowGraphNode* fgNode)
{
return fgNode->isVisited;
}
void FgNodeSetVisited(FlowGraphNode* fgNode,bool visited)
{
fgNode->isVisited = visited;
}
EHRegion* FgNodeGetRegion(FlowGraphNode* fgNode)
{
return fgNode->rgn;
}
void FgNodeSetRegion(FlowGraphNode* fgNode,EHRegion* ehRegion)
{
fgNode->rgn = ehRegion;
}
FlowGraphEdgeList* FgNodeGetFirstNotDeleted(FlowGraphEdgeList *edge)
{
while (edge && edge->isDeletedEdge)
{
edge = edge->next;
}
return edge;
}
FlowGraphEdgeList* FgNodeGetSuccessorList(FlowGraphNode* fgNode)
{
return FgNodeGetFirstNotDeleted(fgNode->succList);
}
FlowGraphEdgeList* FgNodeGetPredecessorList(FlowGraphNode* fgNode)
{
return FgNodeGetFirstNotDeleted(fgNode->predList);
}
// Get the special block-start placekeeping node
IRNode* FgNodeGetStartIRNode(FlowGraphNode* fgNode)
{
return fgNode->startNode;
}
// Get the first non-placekeeping node in block
IRNode* FgNodeGetStartInsertIRNode(FlowGraphNode* fgNode)
{
return fgNode->startNode->next;
}
// Get the special block-end placekeeping node
IRNode* FgNodeGetEndIRNode(FlowGraphNode* fgNode)
{
IRNode* ir = fgNode->startNode->next;
while (ir->kind != IR_block)
{
if (ir->next == NULL)
return ir;
ir = ir->next;
}
return ir->prev;
}
// Get the last non-placekeeping node in block
IRNode* FgNodeGetEndInsertIRNode(FlowGraphNode* fgNode)
{
return FgNodeGetEndIRNode(fgNode);
}
IRNode* FgNodeGetEndIRInsertionPoint(FlowGraphNode* fgNode)
{
return FgNodeGetEndIRNode(fgNode);
}
unsigned int FgNodeGetStartMSILOffset(FlowGraphNode* fg)
{
return fg->startOffset;
}
void FgNodeSetIBCNotReal(FlowGraphNode* fg)
{
}
void FgNodeSetStartMSILOffset(FlowGraphNode* fg, unsigned int offset)
{
fg->startOffset = offset;
IRNode *sNode = fg->startNode;
if (sNode->kind == IR_block)
sNode->msilOffset = offset;
#ifdef DEBUG
else
{
printf("startnode must be block\n");
DebugBreak();
}
#endif
}
unsigned int FgNodeGetEndMSILOffset(FlowGraphNode* fg)
{
return fg->endOffset;
}
void FgNodeSetEndMSILOffset(FlowGraphNode* fgNode, unsigned int offset)
{
fgNode->endOffset = offset;
}
GLOBALVERIFYDATA * FgNodeGetGlobalVerifyData(FlowGraphNode* fg)
{
return fg->globVerData;
}
void FgNodeSetGlobalVerifyData(FlowGraphNode* fg, GLOBALVERIFYDATA * gvData)
{
fg->globVerData = gvData;
}
void FgNodeSetOperandStack(FlowGraphNode* fg, ReaderStack* stack)
{
fg->stack = stack;
}
ReaderStack* FgNodeGetOperandStack(FlowGraphNode* fg)
{
return fg->stack;
}
FlowGraphNode* FgNodeGetIDom(FlowGraphNode* fg)
{
// This routine is used for the dominator based CSE in the reader for SharedStaticBase initialization,
// ClassInit, and TCB Init. If we pass back NULL for an IDOM, then the logic is shut off [unless
// one of these inits has occured in the same basic block]...
return NULL;
}
unsigned FgNodeGetBlockNum(FlowGraphNode* fg)
{
return fg->nBlockNum;
}
FlowGraphEdgeList* FgEdgeListGetNextSuccessor(FlowGraphEdgeList* fgEdge)
{
return FgNodeGetFirstNotDeleted(fgEdge->next);
}
FlowGraphEdgeList* FgEdgeListGetNextPredecessor(FlowGraphEdgeList* fgEdge)
{
return FgNodeGetFirstNotDeleted(fgEdge->next);
}
FlowGraphNode* FgEdgeListGetSource(FlowGraphEdgeList* fgEdge)
{
return fgEdge->block;
}
FlowGraphNode* FgEdgeListGetSink(FlowGraphEdgeList* fgEdge)
{
return fgEdge->block;
}
bool FgEdgeListIsNominal(FlowGraphEdgeList* fgEdge)
{
return fgEdge->isNominal;
}
bool FgEdgeListIsFake(FlowGraphEdgeList* fgEdge)
{
return fgEdge->isFakeForUnreachable;
}
void FgEdgeListMakeFake(FlowGraphEdgeList* fgEdge)
{
fgEdge->isFakeForUnreachable = 1;
}
// Region Interface
// Interface to GenIR defined EHRegion structure
// Implementation Supplied by Jit Client
EHRegion* RgnAllocateRegion(GenIR* genIR)
{
EHRegion* rgn = (EHRegion*)genIR->getProcMemory(sizeof(EHRegion));
return rgn;
}
EHRegionList* RgnAllocateRegionList(GenIR* genIR)
{
EHRegionList* rgnList = (EHRegionList*)genIR->getProcMemory(sizeof(EHRegionList*));
return rgnList;
}
EHRegionList* RgnListGetNext(EHRegionList* ehRegionList)
{
return ehRegionList->next;
}
void RgnListSetNext(EHRegionList* ehRegionList,EHRegionList* next)
{
ehRegionList->next = next;
}
EHRegion* RgnListGetRgn(EHRegionList* ehRegionList)
{
return ehRegionList->region;
}
void RgnListSetRgn(EHRegionList* ehRegionList,EHRegion* rgn)
{
ehRegionList->region = rgn;
}
ReaderBaseNS::RegionKind RgnGetRegionType(EHRegion* ehRegion)
{
return ehRegion->kind;
}
void RgnSetRegionType(EHRegion* ehRegion,ReaderBaseNS::RegionKind type)
{
ehRegion->kind = type;
}
DWORD RgnGetStartMSILOffset(EHRegion* ehRegion)
{
return ehRegion->extentStart;
}
void RgnSetStartMSILOffset(EHRegion* ehRegion,DWORD offset)
{
ehRegion->extentStart = offset;
}
DWORD RgnGetEndMSILOffset(EHRegion* ehRegion)
{
return ehRegion->extentEnd;
}
void RgnSetEndMSILOffset(EHRegion* ehRegion,DWORD offset)
{
ehRegion->extentEnd = offset;
}
IRNode* RgnGetHead(EHRegion* ehRegion)
{
return ehRegion->headNode;
}
void RgnSetHead(EHRegion* ehRegion, IRNode* head)
{
ehRegion->headNode = head;
}
IRNode* RgnGetLast(EHRegion* ehRegion)
{
return ehRegion->lastNode;
}
void RgnSetLast(EHRegion* ehRegion, IRNode* last)
{
ehRegion->lastNode = last;
}
bool RgnGetIsLive(EHRegion *ehRegion)
{
return ehRegion->isLive;
}
void RgnSetIsLive(EHRegion *ehRegion, bool live)
{
ehRegion->isLive = live;
}
void RgnSetParent(EHRegion *ehRegion,EHRegion* parent)
{
ehRegion->parent = parent;
}
EHRegion* RgnGetParent(EHRegion *ehRegion)
{
return ehRegion->parent;
}
void RgnSetChildList(EHRegion *ehRegion,EHRegionList* children)
{
ehRegion->childList = children;
}
EHRegionList* RgnGetChildList(EHRegion *ehRegion)
{
return ehRegion->childList;
}
bool RgnGetHasNonLocalFlow(EHRegion *ehRegion)
{
return ehRegion->hasNonLocalFlow;
}
void RgnSetHasNonLocalFlow(EHRegion *ehRegion,bool nonLocalFlow)
{
ehRegion->hasNonLocalFlow = nonLocalFlow;
}
IRNode* RgnGetEndOfClauses(EHRegion* ehRegion)
{
return NULL;
}
void RgnSetEndOfClauses(EHRegion* ehRegion,IRNode* node)
{
// no-op
return;
}
IRNode* RgnGetTryBodyEnd(EHRegion* ehRegion)
{
return NULL;
}
void RgnSetTryBodyEnd(EHRegion* ehRegion,IRNode* node)
{
// no-op
return;
}
ReaderBaseNS::TryKind RgnGetTryType(EHRegion* ehRegion)
{
return ehRegion->tryType;
}
void RgnSetTryType(EHRegion* ehRegion,ReaderBaseNS::TryKind type)
{
ehRegion->tryType = type;
}
int RgnGetTryCanonicalExitOffset(EHRegion* tryRegion)
{
return tryRegion->canonicalExitOffset;
}
void RgnSetTryCanonicalExitOffset(EHRegion* tryRegion, int offset)
{
tryRegion->canonicalExitOffset = offset;
}
EHRegion* RgnGetExceptFilterRegion(EHRegion* ehRegion)
{
return ehRegion->filterRegion;
}
void RgnSetExceptFilterRegion(EHRegion* ehRegion,EHRegion* filterRegion)
{
ehRegion->filterRegion = filterRegion;
}
EHRegion* RgnGetExceptTryRegion(EHRegion* ehRegion)
{
return ehRegion->tryRegion;
}
void RgnSetExceptTryRegion(EHRegion* ehRegion, EHRegion* tryRegion)
{
ehRegion->tryRegion = tryRegion;
}
bool RgnGetExceptUsesExCode(EHRegion* ehRegion)
{
return ehRegion->usesExCode;
}
void RgnSetExceptUsesExCode(EHRegion* ehRegion, bool usesExceptionCode)
{
ehRegion->usesExCode = usesExceptionCode;
}
EHRegion* RgnGetFilterTryRegion(EHRegion* ehRegion)
{
return ehRegion->tryRegion;
}
void RgnSetFilterTryRegion(EHRegion* ehRegion, EHRegion* tryRegion)
{
ehRegion->tryRegion = tryRegion;
}
EHRegion* RgnGetFilterHandlerRegion(EHRegion* ehRegion)
{
return ehRegion->handlerRegion;
}
void RgnSetFilterHandlerRegion(EHRegion* ehRegion, EHRegion* handler)
{
ehRegion->handlerRegion = handler;
}
EHRegion* RgnGetFinallyTryRegion(EHRegion* finallyRegion)
{
return finallyRegion->tryRegion;
}
void RgnSetFinallyTryRegion(EHRegion* finallyRegion, EHRegion* tryRegion)
{
finallyRegion->tryRegion = tryRegion;
}
bool RgnGetFinallyEndIsReachable(EHRegion* finallyRegion)
{
return finallyRegion->endFinallyIsReachable;
}
void RgnSetFinallyEndIsReachable(EHRegion* finallyRegion, bool isReachable)
{
finallyRegion->endFinallyIsReachable = isReachable;
}
EHRegion* RgnGetFaultTryRegion(EHRegion* faultRegion)
{
return faultRegion->tryRegion;
}
void RgnSetFaultTryRegion(EHRegion* faultRegion,EHRegion* tryRegion)
{
faultRegion->tryRegion = tryRegion;
}
EHRegion* RgnGetCatchTryRegion(EHRegion* catchRegion)
{
return catchRegion->tryRegion;
}
void RgnSetCatchTryRegion(EHRegion* catchRegion,EHRegion* tryRegion)
{
catchRegion->tryRegion = tryRegion;
}
mdToken RgnGetCatchClassToken(EHRegion* catchRegion)
{
return catchRegion->catchClassToken;
}
void RgnSetCatchClassToken(EHRegion* catchRegion, mdToken token)
{
catchRegion->catchClassToken = token;
}
IRNode* IRNodeGetNext(IRNode* node)
{
return (node != NULL) ? node->next : NULL;
}
bool IRNodeIsBranch(IRNode* node)
{
return (node->kind == IR_branch || node->kind == IR_jmp);
}
IRNode* IRNodeGetInsertPointAfterMSILOffset(IRNode* node, unsigned int offset)
{
while (node->kind != IR_block
&& node->kind != IR_switch
&& node->kind != IR_branch
&& node->kind != IR_jmp
&& node->kind != IR_throw_rethrow
&& node->msilOffset <= offset)
{
node = node->next;
}
return node;
}
IRNode* IRNodeGetInsertPointBeforeMSILOffset(IRNode* node, unsigned int offset)
{
while (node->kind != IR_block && node->msilOffset >= offset)
{
node = node->prev;
}
return node;
}
IRNode* IRNodeGetFirstLabelOrInstrNodeInEnclosingBlock(IRNode* handlerStartNode)
{
FlowGraphNode *curFgNode = IRNodeGetEnclosingBlock(handlerStartNode);
IRNode *firstIRNode = handlerStartNode;
// find first label or instr
firstIRNode = curFgNode->startNode;
ASSERT(firstIRNode->kind == IR_block);
firstIRNode = firstIRNode->next;
while (firstIRNode)
{
if (firstIRNode->kind != IR_ehStart)
return firstIRNode;
firstIRNode = firstIRNode->next;
}
return NULL;
}
unsigned int IRNodeGetMSILOffset(IRNode* node)
{
return node->msilOffset;
}
void IRNodeLabelSetMSILOffset(IRNode* node, unsigned int labelMSILOffset)
{
node->msilOffset = labelMSILOffset;
}
void IRNodeBranchSetMSILOffset(IRNode* branchNode, unsigned int offset)
{
branchNode->msilOffset = offset;
}
void IRNodeExceptSetMSILOffset(IRNode* branchNode, unsigned int offset)
{
branchNode->msilOffset = offset;
}
void IRNodeInsertBefore(IRNode* insertionPointTuple, IRNode* newNode)
{
IRNode *prev = insertionPointTuple->prev;
//ASSERTNR(insertionPointTuple == prev->next);
prev->next = newNode;
newNode->prev = prev;
newNode->next = insertionPointTuple;
insertionPointTuple->prev = newNode;
}
void IRNodeInsertAfter(IRNode* insertionPointTuple, IRNode* newNode)
{
IRNode *next = insertionPointTuple->next;
insertionPointTuple->next = newNode;
newNode->prev = insertionPointTuple;
newNode->next = next;
if (next != NULL)
{
//ASSERTNR(next->prev == insertionPointTuple);
next->prev = newNode;
}
}
void IRNodeSetRegion(IRNode* node, EHRegion* region)
{
node->region = region;
}
EHRegion* IRNodeGetRegion(IRNode* node)
{
return node->region;
}
FlowGraphNode* IRNodeGetEnclosingBlock(IRNode* node)
{
while (node->kind != IR_block)
{
node = node->prev;
}
return node->fgNode;
}
bool IRNodeIsLabel(IRNode* node)
{
return (node->kind == IR_label);
}
bool IRNodeIsEHFlowAnnotation(IRNode* node)
{
return (node->kind == IR_ehFlow);
}
// Implementation Supplied by Jit Client.
BranchList* BranchListGetNext(BranchList* branchList)
{
return branchList->next;
}
IRNode* BranchListGetIRNode(BranchList* branchList)
{
return branchList->branch;
}
//
// REQUIRED Flow and Region Graph Manipulation Routines
//
IRNode* GenIR::FgNodeFindStartLabel(FlowGraphNode* block)
{
IRNode *candIRLabel = block->startNode;
while (candIRLabel && candIRLabel->kind != IR_label)
{
candIRLabel = candIRLabel->next;
if (candIRLabel->kind == IR_block)
return NULL;
}
return candIRLabel;
}
BranchList* GenIR::GenIR_FgGetLabelBranchList(IRNode* labelNode)
{
return labelNode->branchList;
}
void fgHelperInsertNodeAtEndOfBlock(IRNode* newNode, IRNode* insertionNode)
{
IRNode *irTemp = insertionNode;
while (irTemp->next && irTemp->next->kind != IR_block)
{
irTemp = irTemp->next;
}
newNode->next = irTemp->next;
irTemp->next = newNode;
if (newNode->next)
newNode->next->prev = newNode;
newNode->prev = irTemp;
}
void GenIR::GenIR_InsertHandlerAnnotation(EHRegion* handlerRegion)
{
FlowGraphNode *fgnode = m_headBlock;
EHRegion *tryRegion = RgnGetParent(handlerRegion);
// edges
// from : all blocks of try
// to : handler region head
while (fgnode)
{
if (fgnode->rgn == tryRegion)
{
IRNode *branch = (IRNode*)getProcMemory(sizeof(IRNode));
branch->kind = IR_ehFlow;
branch->msilOffset = fgnode->startOffset;
branch->isFallThrough = true;
//fgHelperInsertNodeAtEndOfBlock(branch, fgnode->startNode);
IRNodeInsertAfter(fgnode->startNode, branch);
IRNode *irBlock = handlerRegion->headNode;
while (irBlock->kind != IR_block) {
irBlock = irBlock->prev;
}
GenIR_FgAddArc(branch, fgnode, irBlock->fgNode);
}
fgnode = fgnode->next;
}
return;
}
void GenIR::GenIR_InsertRegionAnnotation(IRNode* regionStartTuple,
IRNode* regionEndTuple)
{
return;
}
void GenIR::GenIR_FgAddLabelToBranchList(IRNode* labelNode,
IRNode* branchNode)
{
//ASSERTNR(labelNode != NULL);
//ASSERTNR(branchNode != NULL);
// This is putting the BRANCHing instruction on the BranchList associated with the label.
BranchList *newBranchListElem;
newBranchListElem = (BranchList*)getProcMemory(sizeof(BranchList));
newBranchListElem->branch = branchNode;
newBranchListElem->next = labelNode->branchList;
labelNode->branchList = newBranchListElem;
// And this is putting the LABEL on the BranchList associated with the BRANCHing instruction.
newBranchListElem = (BranchList*)getProcMemory(sizeof(BranchList));
newBranchListElem->branch = labelNode;
newBranchListElem->next = branchNode->branchList;
branchNode->branchList = newBranchListElem;
}
void GenIR::GenIR_FgAddArc(IRNode* branchNode, FlowGraphNode *source,
FlowGraphNode *sink)
{
FlowGraphEdgeList *edge1, *edge2;
edge1 = (FlowGraphEdgeList*)getProcMemory(sizeof(FlowGraphEdgeList));
edge1->block = sink;
edge1->next = source->succList;
edge1->isNominal = false;
edge1->isFakeForUnreachable = false;
source->succList = edge1;
edge2 = (FlowGraphEdgeList*)getProcMemory(sizeof(FlowGraphEdgeList));
edge2->block = source;
edge2->next = sink->predList;
edge2->isNominal = false;
edge1->isFakeForUnreachable = false;
sink->predList = edge2;
if (branchNode != NULL)
{
if ( IRNodeIsEHFlowAnnotation(branchNode)
)
{
edge1->isNominal = edge2->isNominal = true;
}
}
}
bool GenIR::GenIR_FgBlockIsRegionEnd(FlowGraphNode* block)
{
IRNode *irTemp = block->startNode->next;
bool fIsRegionEnd = false;
while (irTemp && irTemp->kind != IR_block)
{
if (irTemp->kind == IR_ehEnd)
{
fIsRegionEnd = true;
break;
}
irTemp = irTemp->next;
}
return fIsRegionEnd;
}
void GenIR::GenIR_FgDeleteBlock(FlowGraphNode* block)
{
}
void GenIR::GenIR_FgDeleteEdge(FlowGraphEdgeList* arc)
{
arc->isDeletedEdge = 1;
}
IRNode* GenIR::GenIR_FgMakeSwitch(IRNode* defaultLabel, IRNode* insert)
{
IRNode *newIR = (IRNode*)getProcMemory(sizeof(IRNode));
newIR->kind = IR_switch;
newIR->isFallThrough = true;
fgHelperInsertNodeAtEndOfBlock(newIR, insert);
return newIR;
}
IRNode* GenIR::GenIR_FgMakeThrow(IRNode* insert)
{
IRNode *newIR = (IRNode*)getProcMemory(sizeof(IRNode));
newIR->kind = IR_throw_rethrow;
newIR->isFallThrough = false;
fgHelperInsertNodeAtEndOfBlock(newIR, insert);
return newIR;
}
IRNode* GenIR::GenIR_FgMakeRethrow(IRNode* insert)
{
IRNode *newIR = (IRNode*)getProcMemory(sizeof(IRNode));
newIR->kind = IR_throw_rethrow;
newIR->isFallThrough = false;
fgHelperInsertNodeAtEndOfBlock(newIR, insert);
return newIR;
}
IRNode* GenIR::GenIR_FgAddCaseToCaseList(IRNode* switchNode,IRNode* labelNode,
unsigned element)
{
// This is some hackiness here. What I'm doing is I'm using the branchList field
// on a switch to be effectively a caseList. That is, we use the BranchList*, and make
// the IRNode* called "branch" simply point to the labels that we are interested in.
//
// The caller of FgAddCaseToCaseList wants to know what to point the actual BranchList
// on the labelNode to. That's why we return switchNode.... we're saying, simply wire up
// the label to be pointing to the switch itself.
BranchList *caseList = (BranchList*)getProcMemory(sizeof(BranchList));
caseList->next = switchNode->branchList;
caseList->branch = labelNode;
switchNode->branchList = caseList;
return switchNode;
}
IRNode* GenIR::GenIR_FgMakeBranch(IRNode* labelNode, IRNode* insertNode,
unsigned int currentOffset, bool fIsConditional,
bool fIsNominal)
{
// Can't have a nominal conditional branch
//ASSERTNR(!(fIsConditional && fIsNominal));
IRNode *branch = (IRNode*)getProcMemory(sizeof(IRNode));
if (fIsNominal)
{
branch->kind = IR_jmp;
}
else
{
branch->kind = IR_branch;
}
branch->msilOffset = currentOffset;
branch->isFallThrough = fIsConditional;
fgHelperInsertNodeAtEndOfBlock(branch, insertNode);
return branch;
}
IRNode* GenIR::GenIR_FgMakeEndFinally(IRNode* insertTup, unsigned int currentOffset, bool fIsLexicalEnd)
{
IRNode *node = (IRNode*)getProcMemory(sizeof(IRNode));
node->kind = IR_endfinally;
node->msilOffset = currentOffset;
node->isFallThrough = false;
fgHelperInsertNodeAtEndOfBlock(node, insertTup);
return node;
}
void
GenIR::GenIR_FgSetBlockToRegion(
FlowGraphNode* block,
EHRegion* region,
unsigned int lastOffset
){
IRNode *node, *lastNode;
FgNodeSetRegion(block,region);
node = FgNodeGetStartInsertIRNode(block);
lastNode = FgNodeGetEndIRNode(block);
while (node != lastNode) {
if (IRNodeGetMSILOffset(node) >= lastOffset) {
// we need to split the block here because of region boundary
FlowGraphNode * newBlock = GenIR_FgSplitBlock(block,node);
FgNodeSetEndMSILOffset(newBlock,FgNodeGetEndMSILOffset(block));
FgNodeSetEndMSILOffset(block,lastOffset);
FgNodeSetStartMSILOffset(newBlock,lastOffset);
FgNodeSetRegion(newBlock,IRNodeGetRegion(node));
break;
}
if (!GenIR_FgIsExceptRegionStartNode(node)) {
IRNodeSetRegion(node,region);
}
node = IRNodeGetNext(node);
//ASSERTNR(NULL != node);
}
}
// create a new block starting before node
FlowGraphNode* GenIR::GenIR_FgSplitBlock(FlowGraphNode* block, IRNode* node)
{
FlowGraphNode *newBlock;
newBlock = (FlowGraphNode*)getProcMemory(sizeof(FlowGraphNode));
newBlock->succList = newBlock->predList = NULL;
newBlock->next = block->next;
block->next = newBlock;
// create new block irnode
newBlock->startNode = (IRNode*)getProcMemory(sizeof(IRNode));
newBlock->startNode->kind = IR_block;
newBlock->startNode->msilOffset = node->msilOffset;
newBlock->startNode->fgNode = newBlock;
newBlock->startNode->prev = node->prev;
newBlock->startNode->isFallThrough = true;
node->prev->next = newBlock->startNode;
newBlock->startNode->next = node;
node->prev = newBlock->startNode;
return newBlock;
}
bool GenIR::GenIR_FgIsExceptRegionStartNode(IRNode* node)
{
return (node->kind == IR_ehStart);
}
bool GenIR::GenIR_FgBlockHasFallThrough(class FlowGraphNode * block)
{
IRNode *cursor = FgNodeGetEndIRNode(block);
// falls through if every irnode in the block falls through.
while (cursor->kind != IR_block)
{
if (cursor->isFallThrough == false)
return false;
cursor = cursor->prev;
}
return true;
}
unsigned GenIR::GenIR_FgGetBlockCount(void)
{
// This code is only called on the ESSA path. In fact, it should be conditionally compiled, IMHO
// ASSERTNR(UNREACHED)
return 0;
}
FlowGraphNode* GenIR::GenIR_FgNodeGetIDom(FlowGraphNode* fg)
{
return NULL;
}
//
//
void GenIR::Ssa_LocAddressTaken(unsigned int idx)
{
// ASSERTNR(UNREACHED)
return;
}
void GenIR::Ssa_ArgAddressTaken(unsigned int idx)
{
// ASSERTNR(UNREACHED)
return;
}
void GenIR::Ssa_VirtPhiPass(FlowGraphNode* h)
{
// ASSERTNR(UNREACHED)
return;
}
void GenIR::Ssa_OptRenameInit(void)
{
// ASSERTNR(UNREACHED)
return;
}
void GenIR::Ssa_CreateDefMap(int * ssaParamCnt, int * ssaLocalCnt)
{
// ASSERTNR(UNREACHED)
#ifdef READER_ESSA
*ssaParamCnt = 0;
*ssaLocalCnt = 0;
#endif
return;
}
void GenIR::Ssa_AddDefPoint(unsigned int def, int offset, bool isLocal)
{
// ASSERTNR(UNREACHED)
return;
}
int GenIR::Ssa_HshMSILScalar(unsigned int opcode,BYTE *operPtr,FlowGraphNode *fg)
{
// ASSERTNR(UNREACHED)
return 0;
}
void GenIR::Ssa_LookAheadEdge(FlowGraphNode * curr, FlowGraphNode * succ, FlowGraphEdgeList * edge)
{
// ASSERTNR(UNREACHED)
return;
}
void GenIR::Ssa_OptPop(FlowGraphNode *block)
{
// ASSERTNR(UNREACHED)
return;
}
void GenIR::Ssa_PushPhis(FlowGraphNode *block)
{
// ASSERTNR(UNREACHED)
return;
}
//
bool GenIR::GenIR_TypesCompatible(IRNode* src1, IRNode* src2)
{
// The no-op JIT does not put anything on the reader stack so we can just ignrore this side-effect
// of web propagation...
return true;
}
void
GenIR::GenIR_VerifyStaticAlignment(
void* fieldAddress,
CorInfoType corInfoType,
unsigned minClassAlign
){
return;
}
bool
GenIR::GenIR_FgOptRecurse(
ReaderBaseNS::CallOpcode opcode,
mdToken token,
bool fIsUnmarkedTailCall
){
// We have no need to do a recursive tail call optimization in the no-op JIT.
return false;
}
void
GenIR::GenIR_FgRevertRecursiveBranch(
IRNode* branchTup
){
//ASSERTNR(TU_OPCODE(branchTup) == OPGOTO);
//ASSERTNR(TU_IS_MSIL_JMP(branchTup));
// reverts to nominal edge
//THX_TupReplaceBranchTarget(branchTup, GenIR_ExitLabel(), FALSE, ciPtr);
// The code in JIT64 does what you see above. I'm hoping that this is unnecessary,
// since we always return false in GenIR_FgOptRecurse().
// ASSERTNR(UNREACHED);
return;
}
bool
GenIR::GenIR_FgEHRegionStartRequiresBlockSplit(IRNode* node)
{
bool fReturn = false;
IRNode *irPrev;
irPrev = node->prev;
if ( irPrev != NULL
&&
( irPrev->kind == IR_ehFlow
|| irPrev->kind == IR_ehStart
|| irPrev->kind == IR_ehEnd
))
{
fReturn = true;
}
return fReturn;
}
IRNode *
GenIR::GenIR_getAddressOfInterfaceVtable(IRNode *tupVtable,
CORINFO_CLASS_HANDLE classHandle, IRNode **newIR)
{
return NULL;
}
IRNode*
GenIR::GenIR_MakeDirectCallTargetNode(
CORINFO_METHOD_HANDLE hMethod,
void *codeAddr
)
{
return NULL;
}
bool
GenIR::GenIR_CanMakeDirectCall(ReaderCallTargetData *callTargetData)
{
return false;
}
bool
GenIR::GenIR_IsTmpVarAndReg( IRNode *val )
{
return false;
}
| 21.298993 | 186 | 0.63837 | [
"object"
] |
c418a28e25369b748d6a194d74e8c571f17de0d8 | 7,829 | cpp | C++ | cradle/tests/imaging/isobands.cpp | dotdecimal/open-cradle | f8b06f8d40b0f17ac8d2bf845a32fcd57bf5ce1d | [
"MIT"
] | null | null | null | cradle/tests/imaging/isobands.cpp | dotdecimal/open-cradle | f8b06f8d40b0f17ac8d2bf845a32fcd57bf5ce1d | [
"MIT"
] | null | null | null | cradle/tests/imaging/isobands.cpp | dotdecimal/open-cradle | f8b06f8d40b0f17ac8d2bf845a32fcd57bf5ce1d | [
"MIT"
] | 4 | 2018-09-28T17:12:54.000Z | 2022-03-20T14:22:29.000Z | #include <cradle/imaging/isobands.hpp>
#include <cradle/imaging/isolines.hpp>
#include <cradle/imaging/image.hpp>
#include <cradle/imaging/geometry.hpp>
#include <cradle/geometry/polygonal.hpp>
#include <algorithm>
#define BOOST_TEST_MODULE isobands
#include <cradle/imaging/test.hpp>
double tolerance = 0.001;
using namespace cradle;
double total_area(std::vector<triangle<2,double> > const& tris)
{
double area = 0;
for (std::vector<triangle<2,double> >::const_iterator
i = tris.begin(); i != tris.end(); ++i)
{
area += get_area(*i);
}
return area;
}
bool isolines_match_isobands(
std::vector<line_segment<2,double> > const& lines,
std::vector<triangle<2,double> > const& tris)
{
for (std::vector<line_segment<2,double> >::const_iterator
i = lines.begin(); i != lines.end(); ++i)
{
for (std::vector<triangle<2,double> >::const_iterator
j = tris.begin(); j != tris.end(); ++j)
{
for (int k = 0; k != 2; ++k)
{
for (int l = 0; l != 3; ++l)
{
if (almost_equal((*i)[k], (*j)[l], tolerance))
goto found_vertex;
}
goto no_match;
found_vertex:
;
}
goto found_segment;
no_match:
;
}
return false;
found_segment:
;
}
return true;
}
std::vector<polygon2> as_polygons(
std::vector<triangle<2,double> > const& tris)
{
size_t n_tris = tris.size();
std::vector<polygon2> polys(n_tris);
for (size_t i = 0; i != n_tris; ++i)
polys[i] = as_polygon(tris[i]);
return polys;
}
bool all_ccw(std::vector<triangle<2,double> > const& tris)
{
for (std::vector<triangle<2,double> >::const_iterator
i = tris.begin(); i != tris.end(); ++i)
{
if (!is_ccw(*i))
return false;
}
return true;
}
BOOST_AUTO_TEST_CASE(isobands_test)
{
// There are three significant values in the isobands algorithm:
// - below the low level
// - above the high level
// - in between
// Given a 2x2 square in the image, there are five points of interest to
// the algorithm: the four corners and the center.
// Thus, there are 3 ^ 5 possible 2x2 squares that might yield different
// results from the algorithm. The following image is constructed such
// that it has all of them.
image<2,int8_t,unique> img;
create_image(img, make_vector<unsigned>(18, 54));
img.value_mapping = linear_function<double>(1, 0.5);
set_spatial_mapping(
img, make_vector<double>(-1, 0), make_vector<double>(2, 3));
for (unsigned i = 0; i != 27; ++i)
{
unsigned index[5];
index[4] = i / 9;
index[3] = (i / 3) % 3;
index[2] = i % 3;
for (unsigned j = 0; j != 9; ++j)
{
index[1] = (j / 3) % 3;
index[0] = j % 3;
// With the value mapping above, these will translate to
// { 1.5, 3, 4.5 }.
// The iso levels we're interested in are 2 and 4.
int8_t values[3] = { 1, 4, 7 };
// Skew the average towards the level of index[4].
switch (index[4])
{
case 0:
values[0] -= 100;
break;
case 2:
values[2] += 100;
break;
}
// Assign the four pixel values.
get_pixel_ref(img, make_vector(j * 2 + 0, i * 2 + 0)) =
values[index[0]];
get_pixel_ref(img, make_vector(j * 2 + 1, i * 2 + 0)) =
values[index[1]];
get_pixel_ref(img, make_vector(j * 2 + 0, i * 2 + 1)) =
values[index[2]];
get_pixel_ref(img, make_vector(j * 2 + 1, i * 2 + 1)) =
values[index[3]];
}
}
// Construct the isobands for values below 2.
auto low_tris = compute_isobands(img, -100, 2);
// Construct the isobands for values between 2 and 4.
auto middle_tris = compute_isobands(img, 2, 4);
// Construct the isobands for values above 4.
auto high_tris = compute_isobands(img, 4, 100);
// All the triangles should be CCW.
BOOST_CHECK(all_ccw(low_tris));
BOOST_CHECK(all_ccw(middle_tris));
BOOST_CHECK(all_ccw(high_tris));
// Create polysets to represent the three bands.
polyset low_region;
create_polyset_from_polygons(&low_region, as_polygons(low_tris));
polyset middle_region;
create_polyset_from_polygons(&middle_region, as_polygons(middle_tris));
polyset high_region;
create_polyset_from_polygons(&high_region, as_polygons(high_tris));
// The total area of the triangles in each region should equal the area of
// the region itself.
// Allow a little more tolerance here because the error accumulates.
CRADLE_CHECK_WITHIN_TOLERANCE(total_area(low_tris),
get_area(low_region), 0.1);
CRADLE_CHECK_WITHIN_TOLERANCE(total_area(middle_tris),
get_area(middle_region), 0.1);
CRADLE_CHECK_WITHIN_TOLERANCE(total_area(high_tris),
get_area(high_region), 0.1);
// There should be no overlap between any of the regions.
polyset overlap;
do_set_operation(&overlap, set_operation::INTERSECTION, low_region,
middle_region);
BOOST_CHECK(almost_equal(get_area(overlap), 0., tolerance));
do_set_operation(&overlap, set_operation::INTERSECTION, low_region,
high_region);
BOOST_CHECK(almost_equal(get_area(overlap), 0., tolerance));
do_set_operation(&overlap, set_operation::INTERSECTION, middle_region,
high_region);
BOOST_CHECK(almost_equal(get_area(overlap), 0., tolerance));
// The union of the three regions should be the bounding box of the
// image.
polyset full_region;
do_set_operation(&full_region, set_operation::UNION, low_region,
middle_region);
do_set_operation(&full_region, set_operation::UNION, full_region,
high_region);
polyset img_box;
create_polyset(&img_box, as_polygon(get_bounding_box(img)));
BOOST_CHECK(almost_equal(full_region, img_box, 0.001));
// Construct the isobands for values between 2.5 and 3.5.
// These bands should lie strictly inside the middle region.
auto inner_tris = compute_isobands(img, 2, 4);
polyset inner_region;
create_polyset_from_polygons(&inner_region, as_polygons(inner_tris));
do_set_operation(&overlap, set_operation::INTERSECTION, inner_region,
middle_region);
BOOST_CHECK(almost_equal(overlap, inner_region, tolerance));
// Loop through each image point and check that it's in the proper region.
for (unsigned i = 0; i != 54; ++i)
{
for (unsigned j = 0; j != 18; ++j)
{
vector2d p = get_pixel_center(img, make_vector(j, i));
double value = apply(img.value_mapping,
get_pixel_ref(img, make_vector(j, i)));
polyset* region;
if (value < 2)
region = &low_region;
else if (value < 4)
region = &middle_region;
else
region = &high_region;
BOOST_CHECK(is_inside(*region, p));
}
}
// Generate the isolines at 2 and 4 and check that the isolines appear as
// edges in the isobands.
auto low_lines = compute_isolines(img, 2);
BOOST_CHECK(isolines_match_isobands(low_lines, low_tris));
BOOST_CHECK(isolines_match_isobands(low_lines, middle_tris));
auto high_lines = compute_isolines(img, 4);
BOOST_CHECK(isolines_match_isobands(high_lines, middle_tris));
close_isoline_contours(high_lines, img, 4);
BOOST_CHECK(isolines_match_isobands(high_lines, high_tris));
}
| 35.265766 | 78 | 0.608762 | [
"geometry",
"vector"
] |
c41a67112c0418dba811763041e81f57d2e2db41 | 10,814 | hpp | C++ | include/mem/SubtypeAllocator/refc.hpp | fabianbs96/pool_allocator | 1bdeedc4dc1064beb2e51f8e60c9a2dda5654ab9 | [
"MIT"
] | null | null | null | include/mem/SubtypeAllocator/refc.hpp | fabianbs96/pool_allocator | 1bdeedc4dc1064beb2e51f8e60c9a2dda5654ab9 | [
"MIT"
] | null | null | null | include/mem/SubtypeAllocator/refc.hpp | fabianbs96/pool_allocator | 1bdeedc4dc1064beb2e51f8e60c9a2dda5654ab9 | [
"MIT"
] | null | null | null | #pragma once
#include <atomic>
#include <cassert>
#include <type_traits>
#ifdef HAVE_LLVM
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/Support/Hashing.h"
#endif
#include "mem/SubtypeAllocator/SubtypeAllocatorDriver.hpp"
#include "mem/SubtypeAllocator/detail/SubtypeAllocatorDriverBase.hpp"
namespace mem {
template <typename T> class enable_refc_from_this;
namespace detail {
class refc_base {
protected:
struct counter {
std::atomic_size_t Ctr;
size_t Id;
detail::SubtypeAllocatorDriverBase *Del;
counter(size_t Ctr, size_t Id,
detail::SubtypeAllocatorDriverBase *Del) noexcept
: Ctr(Ctr), Id(Id), Del(Del) {}
};
counter *Data = nullptr;
explicit refc_base(counter *Data) noexcept : Data(Data) {}
explicit refc_base(const refc_base &Other) noexcept : Data(Other.Data) {}
};
} // namespace detail
/// \brief A reference-counted smart-pointer, similar to \c std::shared_ptr, but
/// optimized for use with SubtypeAllocatorDriver.
///
/// Objects of this type should not be created manually, but using a
/// RefcFactory that handles the internal details. Furthermore, no arrays should
/// be managed with refc. \tparam T The type (or a base type of) the object
/// where this smart-pointer points to
template <typename T> class refc final : public detail::refc_base {
public:
using counter = detail::refc_base::counter;
// For internal use only
struct one_allocation : public counter {
std::aligned_storage_t<sizeof(T), alignof(T)> Data;
using counter::counter;
};
/// \brief A class that allows allocating a singleton object as refc without a
/// SubtypeAllocatorDriver.
///
/// Objects of this type can neither be copied, nor moved. The intended usage
/// is to store them in a static variable and only work with them via a refc
/// view.
class singleton : one_allocation {
friend class refc<T>;
public:
/// \brief Creates the wrapped object and forwards \p args to its
/// constructor
template <typename... Args>
singleton(Args &&... args) noexcept(
std::is_nothrow_constructible_v<T, Args...>)
: one_allocation(1, detail::SubtypeAllocatorDriverBase::InvalidId,
nullptr) {
new (&this->Data) T(std::forward<Args>(args)...);
}
singleton(const singleton &) = delete;
singleton(singleton &&) = delete;
};
private:
explicit refc(one_allocation *Data) noexcept : refc_base(Data) {}
explicit refc(one_allocation *Data, std::true_type increase_counter) noexcept
: refc_base(Data) {
if (Data) {
Data->Ctr.fetch_add(1, std::memory_order_relaxed);
}
}
public:
refc(std::nullptr_t) noexcept : refc_base(nullptr) {}
/// \brief Creates a refc from static singleton data
refc(singleton &Singleton) noexcept : refc(&Singleton, std::true_type{}) {}
/// \brief For internal use only.
///
/// \param[in] Del The SubtypeAllocatorDriver that should be used for
/// allocating the object with associated control-block
/// \param[in] Id The (cached) ID used for allocating a \c
/// refc<T>::one_allocation with \p Del
/// \param args The arguments that should be perfectly forwarded to the actual
/// constructor of \p T.
template <size_t AllocBlockSize, typename... Args>
refc(SubtypeAllocatorDriver<AllocBlockSize> *Del,
detail::SubtypeAllocatorDriverBase::UserAllocatorId Id, Args &&... args)
: refc_base(nullptr) {
auto mem = reinterpret_cast<one_allocation *>(Del->allocate(Id));
auto Ptr = &mem->Data;
auto Ctr = static_cast<counter *>(mem);
new (Ctr) counter(1, Id, Del);
try {
new (Ptr) T(std::forward<Args>(args)...);
} catch (...) {
Del->deallocate(mem, Id);
// Ptr = nullptr;
// Ctr = nullptr;
throw;
}
Data = mem;
}
/// Copy constructor. Increments the reference-counter by one.
refc(const refc &Other) noexcept : refc_base(Other.Data) {
if (Data) {
assert(Other.Data->Del);
Data->Ctr.fetch_add(1, std::memory_order_relaxed);
}
}
/// Polymorphic copy constructor. Increments the reference-counter by one.
template <typename U, typename = std::enable_if_t<std::is_base_of_v<T, U>>>
refc(const refc<U> &Other) noexcept : refc_base(Other) {
if (Data) {
constexpr size_t MagicPointer = 0x10000000000;
// Unfortunately cannot reinterpret_cast inside a constexpr
assert(static_cast<T *>(reinterpret_cast<U *>(MagicPointer)) ==
reinterpret_cast<T *>(MagicPointer));
assert(Data->Del);
Data->Ctr.fetch_add(1, std::memory_order_relaxed);
}
}
/// Move constructor. Does not touch the reference-counter. Leaves \p Other in
/// \c nullptr state.
refc(refc &&Other) noexcept : refc_base(Other.Data) { Other.Data = nullptr; }
/// Polymorphic move constructor. Does not touch the reference-counter. Leaves
/// \p Other in \c nullptr state.
template <typename U, typename = std::enable_if_t<std::is_base_of_v<T, U>>>
refc(refc<U> &&Other) noexcept : refc_base(Other) {
constexpr size_t MagicPointer = 0x10000000000;
assert(!Data || static_cast<T *>(reinterpret_cast<U *>(MagicPointer)) ==
reinterpret_cast<T *>(MagicPointer));
assert(!Data || Data->Del);
Other.Data = nullptr;
}
/// Destructor. Decrements the reference-counter by one. If it reaches \c 0,
/// uses the stored SubtypeAllocatorDriver to deallocate the object woth
/// control-block.
/// Leaves this object in \c nullptr state
~refc() {
if (!*this)
return;
auto dat = static_cast<one_allocation *>(Data);
Data = nullptr;
auto oldUseCount = dat->Ctr.fetch_sub(1, std::memory_order_relaxed);
if (oldUseCount == 1 && dat->Del) {
auto *dataPtr = reinterpret_cast<T *>(&dat->Data);
try {
dataPtr->~T();
} catch (...) {
dat->Del->deallocate(dat, dat->Id);
throw;
}
dat->Del->deallocate(dat, dat->Id);
}
}
inline T *get() noexcept {
return reinterpret_cast<T *>(&static_cast<one_allocation *>(Data)->Data);
}
inline const T *get() const noexcept {
return reinterpret_cast<const T *>(
&static_cast<one_allocation *>(Data)->Data);
}
inline T *operator->() noexcept { return get(); }
inline const T *operator->() const noexcept { return get(); }
inline T &operator*() noexcept { return *get(); }
inline const T &operator*() const noexcept { return *get(); }
/// Same as *this != nullptr && *this != getEmptyKey() && *this !=
/// getTombstoneKey()
operator bool() const noexcept { return size_t(Data + 2) < 3; }
/// Checks whether this smart-pointer is in the \c nullptr state which means
/// the pointee cannot be accessed.
bool operator==(std::nullptr_t) const noexcept { return Data; }
/// Checks pointer-equality with the Other refc smart pointer.
/// Fails at compile-time, if \p T and \p U are not in the same inheritance
/// hierarchy
template <typename U, typename = std::enable_if_t<std::is_same_v<T, U> ||
std::is_base_of_v<U, T> ||
std::is_base_of_v<T, U>>>
bool operator==(const refc<U> &Other) const noexcept {
return Data == Other.Data;
}
/// Checks pointer-inequality with the Other refc smart pointer
template <typename U> bool operator!=(const refc<U> &Other) const noexcept {
return !(*this == Other);
}
/// Checks pointer-equality with the Other pointer.
bool operator==(const T *Other) const noexcept { return get() == Other; }
/// Checks pointer-inequality with the Other pointer.
bool operator!=(const T *Other) const noexcept { return !(*this == Other); }
/// Checks pointer-equality between \p Ptr1 and \p Ptr2
friend bool operator==(const T *Ptr1, const refc<T> &Ptr2) {
return Ptr2 == Ptr1;
}
/// Checks pointer-inequality between \p Ptr1 and \p Ptr2
friend bool operator!=(const T *Ptr1, const refc<T> &Ptr2) {
return Ptr2 != Ptr1;
}
private:
friend class enable_refc_from_this<T>;
#ifdef HAVE_LLVM
friend class llvm::DenseMapInfo<refc<T>>;
#endif
/// For internal use only.
///
/// Creates an INVALID refc smart pointer for use as empty-key in an
/// llvm::[Small]Dense{Set,Map}
static refc getEmptyKey() noexcept { return refc((one_allocation *)-1); }
/// For internal use only.
///
/// Creates an INVALID refc smart pointer for use as tombstone-key in an
/// llvm::[Small]Dense{Set,Map}
static refc getTombstoneKey() noexcept { return refc((one_allocation *)-2); }
/// For internal use only.
///
/// Creates a refc<T> from the given pointer \p Ptr assuming, but not checking
/// that it was allocated as refc<T>. Used in the internal implementation from
/// enable_refc_from_this
static refc refc_from_this(T *Ptr) {
if (!Ptr)
return nullptr;
constexpr const auto diff = offsetof(one_allocation, Data);
return refc(reinterpret_cast<one_allocation *>(
reinterpret_cast<char *>(Ptr) - diff),
std::true_type{});
}
};
template <typename T> class enable_refc_from_this {
public:
refc<T> refc_from_this() {
static_assert(std::is_base_of_v<enable_refc_from_this<T>, T>,
"Invalid usage of enable_refc_from_this; the template "
"parameter must equal the implementing class");
return refc<T>::refc_from_this(static_cast<T *>(this));
}
const refc<T> refc_from_this() const {
static_assert(std::is_base_of_v<enable_refc_from_this<T>, T>,
"Invalid usage of enable_refc_from_this; the template "
"parameter must equal the implementing class");
return refc<T>::refc_from_this(const_cast<T *>(this));
}
};
#ifdef HAVE_LLVM
template <typename T> llvm::hash_code hash_value(const refc<T> &Rc) {
return llvm::hash_combine(llvm::hash_value(RC.get()));
}
#endif
} // namespace mem
namespace std {
template <typename T> struct hash<mem::refc<T>> {
size_t operator()(const mem::refc<T> &Rc) const noexcept {
constexpr size_t MagicFactor =
sizeof(size_t) == 32 ? 2654435769UL : 11400714819323198485LLU;
return std::hash<const T *>()() * MagicFactor;
}
};
} // namespace std
#ifdef HAVE_LLVM
namespace llvm {
template <typename T> struct DenseMapInfo<mem::refc<T>> {
static inline mem::refc<T> getEmptyKey() {
return mem::refc<T>::getEmptyKey();
}
static inline mem::refc<T> getTombstoneKey() {
return mem::refc<T>::getTombstoneKey();
}
static inline bool isEqual(const mem::refc<T> &Rc1, const mem::refc<T> &Rc2) {
return Rc1 == Rc2;
}
static inline unsigned getHashValue(const mem::refc<T> &Rc) {
return hash_value(Rc);
}
};
} // namespace llvm
#endif | 32.869301 | 80 | 0.659423 | [
"object"
] |
c41f4422291d4e81066e876e7dd8241d87b2e84d | 3,855 | hpp | C++ | src/age_common/api/age_types.hpp | c-sp/AGE | 054bc4c7c0fe703439b73575d56a23eb3700d695 | [
"Apache-2.0"
] | 2 | 2022-02-12T12:51:14.000Z | 2022-02-13T19:14:36.000Z | src/age_common/api/age_types.hpp | c-sp/AGE | 054bc4c7c0fe703439b73575d56a23eb3700d695 | [
"Apache-2.0"
] | 4 | 2021-05-19T18:11:22.000Z | 2021-09-27T18:17:26.000Z | src/age_common/api/age_types.hpp | c-sp/AGE | 054bc4c7c0fe703439b73575d56a23eb3700d695 | [
"Apache-2.0"
] | null | null | null | //
// Copyright 2020 Christoph Sprenger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef AGE_TYPES_HPP
#define AGE_TYPES_HPP
//!
//! \file
//!
#include <array>
#include <cstdint> // std::uint8_t etc.
#include <limits>
#include <type_traits> // std::underlying_type
#include <vector>
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define AGE_DISABLE_COPY(Class) \
private: \
Class(const Class&) = delete; \
Class& operator=(const Class&) = delete
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define AGE_DISABLE_MOVE(Class) \
private: \
Class(const Class&&) = delete; \
Class& operator=(const Class&&) = delete
// Use this to mark unused (but required) parameters,
// e.g. for callbacks.
//
// See also:
// https://stackoverflow.com/questions/1486904/how-do-i-best-silence-a-warning-about-unused-variables#comment51105057_1486931
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define AGE_UNUSED(arg) ((void) &(arg))
namespace age
{
// C++ arithmetic operators do not accept types smaller than int
// (see https://en.cppreference.com/w/cpp/language/implicit_conversion).
// AGE relies on int being 32 bits or more.
static_assert(sizeof(int) >= 4, "AGE requires int being at least 32 bits wide");
static_assert(sizeof(unsigned) == sizeof(int), "AGE requires unsigned int being exactly as wide as int");
static_assert(sizeof(std::size_t) >= sizeof(int), "AGE requires std::size_t to be at least as wide as int");
// types
// (define the STL integer types as part of the age namespace for less verbose code)
using uint8_t = std::uint8_t;
using uint16_t = std::uint16_t;
using uint32_t = std::uint32_t;
using uint64_t = std::uint64_t;
using int8_t = std::int8_t;
using int16_t = std::int16_t;
using int32_t = std::int32_t;
using int64_t = std::int64_t;
using size_t = std::size_t;
template<size_t Size>
using uint8_array = std::array<uint8_t, Size>;
using uint8_vector = std::vector<uint8_t>;
// constant expressions
constexpr int int_max = std::numeric_limits<int>::max();
constexpr int16_t int16_t_max = std::numeric_limits<int16_t>::max();
constexpr int16_t int16_t_min = std::numeric_limits<int16_t>::min();
constexpr int32_t int32_t_max = std::numeric_limits<int32_t>::max();
// utility functions
//!
//! Convert the specified enum value to the associated value of the underlying type.
//! See also: https://stackoverflow.com/a/14589519
//!
//! Can be replaced by std::to_underlying with C++23.
//!
template<typename Enum>
constexpr auto to_underlying(Enum e) -> typename std::underlying_type<Enum>::type
{
return static_cast<typename std::underlying_type<Enum>::type>(e);
}
//!
//! Return the size in bytes of the specified array's data.
//! This is not necessarily equal to sizeof(arr) as the latter may include
//! additional members in std::array after the actual array data.
//!
template<typename Type, size_t Size>
constexpr auto sizeof_array(std::array<Type, Size> arr) -> std::size_t
{
return arr.size() * sizeof(typename std::array<Type, Size>::value_type);
}
} // namespace age
#endif // AGE_TYPES_HPP
| 29.653846 | 125 | 0.68249 | [
"vector"
] |
c421f4c82cb327b1f2cf80c4415fc0eff3285aa7 | 11,489 | hpp | C++ | blast/include/algo/blast/api/blast_types.hpp | mycolab/ncbi-blast | e59746cec78044d2bf6d65de644717c42f80b098 | [
"Apache-2.0"
] | null | null | null | blast/include/algo/blast/api/blast_types.hpp | mycolab/ncbi-blast | e59746cec78044d2bf6d65de644717c42f80b098 | [
"Apache-2.0"
] | null | null | null | blast/include/algo/blast/api/blast_types.hpp | mycolab/ncbi-blast | e59746cec78044d2bf6d65de644717c42f80b098 | [
"Apache-2.0"
] | null | null | null | /* $Id: blast_types.hpp 573102 2018-10-23 12:07:38Z fongah2 $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government Work" under the
* terms of the United States Copyright Act. It was written as part of
* the author's official duties as a United States Government employee and
* thus cannot be copyrighted. This software/database is freely available
* to the public for use. The National Library of Medicine and the U.S.
* Government have not placed any restriction on its use or reproduction.
*
* Although all reasonable efforts have been taken to ensure the accuracy
* and reliability of the software and data, the NLM and the U.S.
* Government do not and cannot warrant the performance or results that
* may be obtained by using this software or data. The NLM and the U.S.
* Government disclaim all warranties, express or implied, including
* warranties of performance, merchantability or fitness for any particular
* purpose.
*
* Please cite the author in any work or product based on this material.
*
* ===========================================================================
*
* Author: Ilya Dondoshansky
*
*/
/** @file blast_types.hpp
* Definitions of special type used in BLAST
*/
#ifndef ALGO_BLAST_API___BLAST_TYPE__HPP
#define ALGO_BLAST_API___BLAST_TYPE__HPP
#include <corelib/ncbistd.hpp>
#include <objects/seqalign/Seq_align_set.hpp>
#include <algo/blast/core/blast_export.h>
#include <algo/blast/core/blast_message.h>
#include <algo/blast/core/blast_def.h>
#include <algo/blast/core/blast_filter.h>
BEGIN_NCBI_SCOPE
BEGIN_SCOPE(blast)
/// This enumeration is to evolve into a task/program specific list that
/// specifies sets of default parameters to easily conduct searches using
/// BLAST.
/// @todo EProgram needs to be renamed to denote a task (similar to those
/// exposed by the BLAST web page) rather than a program type
/// N.B.: When making changes to this enumeration, please update
/// blast::ProgramNameToEnum (blast_aux.[ch]pp), blast::GetNumberOfFrames
/// (blast_setup_cxx.cpp) and BlastNumber2Program and BlastProgram2Number
/// (blast_util.c)
enum EProgram {
eBlastNotSet = 0, ///< Not yet set.
eBlastn, ///< Nucl-Nucl (traditional blastn)
eBlastp, ///< Protein-Protein
eBlastx, ///< Translated nucl-Protein
eTblastn, ///< Protein-Translated nucl
eTblastx, ///< Translated nucl-Translated nucl
eRPSBlast, ///< protein-pssm (reverse-position-specific BLAST)
eRPSTblastn, ///< nucleotide-pssm (RPS blast with translated query)
eMegablast, ///< Nucl-Nucl (traditional megablast)
eDiscMegablast, ///< Nucl-Nucl using discontiguous megablast
ePSIBlast, ///< PSI Blast
ePSITblastn, ///< PSI Tblastn
ePHIBlastp, ///< Protein PHI BLAST
ePHIBlastn, ///< Nucleotide PHI BLAST
eDeltaBlast, ///< Delta Blast
eVecScreen, ///< Vector screening
eMapper, ///< Jumper alignment for mapping
eKBlastp, ///< KMER screening and BLASTP
eBlastProgramMax ///< Undefined program
};
/** Convert a EProgram enumeration value to a task name (as those used in the
* BLAST command line binaries)
* @param p EProgram enumeration value to convert [in]
*/
NCBI_XBLAST_EXPORT
string EProgramToTaskName(EProgram p);
/// Map a string into an element of the ncbi::blast::EProgram enumeration
/// (except eBlastProgramMax).
/// @param program_name [in]
/// @return an element of the ncbi::blast::EProgram enumeration, except
/// eBlastProgramMax
/// @throws CBlastException if the string does not map into any of the EProgram
/// elements
NCBI_XBLAST_EXPORT
EProgram ProgramNameToEnum(const std::string& program_name);
/// Validates that the task provided is indeed a valid task, otherwise throws a
/// CBlastException
/// @param task task name to validate [in]
NCBI_XBLAST_EXPORT
void ThrowIfInvalidTask(const string& task);
/// Convert EProgram to EBlastProgramType.
/// @param p Program expressed as an api layer EProgram.
/// @return Same program using the core enumeration.
NCBI_XBLAST_EXPORT
EBlastProgramType
EProgramToEBlastProgramType(EProgram p);
/// Error or Warning Message from search.
///
/// This class encapsulates a single error or warning message returned
/// from a search. These include conditions detected by the algorithm
/// where no exception is thrown, but which impact the completeness or
/// accuracy of search results. One example might be a completely
/// masked query.
class CSearchMessage : public CObject {
public:
/// Construct a search message object.
/// @param severity The severity of this message. [in]
/// @param error_id A number unique to this error. [in]
/// @param message A description of the error for the user. [in]
CSearchMessage(EBlastSeverity severity,
int error_id,
const string & message)
: m_Severity(severity), m_ErrorId(error_id), m_Message(message)
{
}
/// Construct an empty search message object.
CSearchMessage()
: m_Severity(EBlastSeverity(0)), m_ErrorId(0)
{
}
/// Get the severity of this message.
/// @return The severity of this message.
EBlastSeverity GetSeverity() const
{
return m_Severity;
}
/// Adjust the severity of this message.
/// @param sev The severity to assign. [in]
void SetSeverity(EBlastSeverity sev) { m_Severity = sev; }
/// Get the severity of this message as a string.
/// @return A symbolic name for the severity level (such as "Warning").
string GetSeverityString() const
{
return GetSeverityString(m_Severity);
}
/// Get the symbolic name for a level of severity as a string.
/// @param severity The severity as an enumeration.
/// @return A symbolic name for the severity level (such as "Warning").
static string GetSeverityString(EBlastSeverity severity)
{
switch(severity) {
case eBlastSevInfo: return "Informational Message";
case eBlastSevWarning: return "Warning";
case eBlastSevError: return "Error";
case eBlastSevFatal: return "Fatal Error";
}
return "Message";
}
/// Get the error identifier.
/// @return An identifier unique to this specific message.
int GetErrorId() const
{
return m_ErrorId;
}
/// Set the error message.
/// @return A reference allowing the user to set the error string.
string& SetMessage(void) { return m_Message; }
/// Get the error message.
/// @return A message describing this error or warning.
string GetMessage(bool withSeverity = true) const
{
if (withSeverity) {
return GetSeverityString() + ": " + m_Message;
}
return m_Message;
}
/// Compare two error messages for equality.
/// @return True if the messages are the same.
bool operator==(const CSearchMessage& rhs) const;
/// Compare two error messages for inequality.
/// @return True if the messages are not the same.
bool operator!=(const CSearchMessage& rhs) const;
/// Compare two error messages for order.
/// @return True if the first message is less than the second.
bool operator<(const CSearchMessage& rhs) const;
private:
/// The severity of this error or warning message.
EBlastSeverity m_Severity;
/// A unique identifier specifying what kind of error this is.
int m_ErrorId;
/// A message describing the error to the application user.
string m_Message;
};
/// Class for the messages for an individual query sequence.
class NCBI_XBLAST_EXPORT TQueryMessages : public vector< CRef<CSearchMessage> >
{
public:
/// Set the query id as a string.
/// @param id The query id.
void SetQueryId(const string& id);
/// Get the query id as a string.
/// @return The query id.
string GetQueryId() const;
/// Combine other messages with these.
/// @param other The second list of messages.
void Combine(const TQueryMessages& other);
private:
/// The query identifier.
string m_IdString;
};
/// typedef for the messages for an entire BLAST search, which could be
/// comprised of multiple query sequences
class NCBI_XBLAST_EXPORT TSearchMessages : public vector<TQueryMessages>
{
public:
/// Add a message for all queries.
/// @param severity The severity of this message. [in]
/// @param error_id A number unique to this error. [in]
/// @param message A description of the error for the user. [in]
void AddMessageAllQueries(EBlastSeverity severity,
int error_id,
const string & message);
/// @return true if messages exist.
bool HasMessages() const;
/// Converts messages to a string, which is returned.
/// @return A string containing all such messages.
string ToString() const;
/// Combine another set of search messages with this one.
///
/// Another set of messages is combined with these; each element
/// of the other set is combined with the element of this set
/// having the same index. The size of both sets must match.
///
/// @param other_msgs Other messages to add to these.
void Combine(const TSearchMessages& other_msgs);
/// Find and remove redundant messages.
void RemoveDuplicates();
};
/// Specifies the style of Seq-aligns that should be built from the
/// internal BLAST data structures
enum EResultType {
eDatabaseSearch, ///< Seq-aligns in the style of a database search
eSequenceComparison /**< Seq-aligns in the BLAST 2 Sequence style (one
alignment per query-subject pair) */
};
/// Vector of Seq-align-sets
typedef vector< CRef<objects::CSeq_align_set> > TSeqAlignVector;
inline bool
CSearchMessage::operator==(const CSearchMessage& rhs) const
{
if (m_Severity == rhs.m_Severity &&
m_ErrorId == rhs.m_ErrorId &&
m_Message == rhs.m_Message) {
return true;
} else {
return false;
}
}
inline bool
CSearchMessage::operator!=(const CSearchMessage& rhs) const
{
return !(*this == rhs);
}
inline bool
CSearchMessage::operator<(const CSearchMessage& rhs) const
{
if (m_ErrorId < rhs.m_ErrorId ||
m_Severity < rhs.m_Severity ||
m_Message < rhs.m_Message) {
return true;
} else {
return false;
}
}
/// Wrapper for BlastSeqLoc structure.
class CBlastSeqLocWrap : public CObject
{
public:
/// Instance constructor.
/// @param locs pointer to the object to hold
CBlastSeqLocWrap( BlastSeqLoc * locs ) : locs_( locs ) {}
/// Instance destructor.
virtual ~CBlastSeqLocWrap() { BlastSeqLocFree( locs_ ); }
/// Get access to the held object.
/// @return pointer storred by the wrapping object
BlastSeqLoc * getLocs() const { return locs_; }
private:
BlastSeqLoc * locs_; ///< Wrapped pointer.
};
END_SCOPE(blast)
END_NCBI_SCOPE
#endif /* ALGO_BLAST_API___BLAST_TYPE__HPP */
| 34.70997 | 79 | 0.662634 | [
"object",
"vector"
] |
c4231b52d9f1f20ca72c996762d43083b3850e62 | 4,190 | cpp | C++ | src/game/client/hl2/energy_wave_effect.cpp | bluedogz162/tf_coop_extended_custom | 0212744ebef4f74c4e0047320d9da7d8571a8ee0 | [
"Unlicense"
] | 4 | 2020-04-24T22:20:34.000Z | 2022-01-10T23:16:53.000Z | src/game/client/hl2/energy_wave_effect.cpp | bluedogz162/tf_coop_extended_custom | 0212744ebef4f74c4e0047320d9da7d8571a8ee0 | [
"Unlicense"
] | 1 | 2020-05-01T19:13:25.000Z | 2020-05-02T07:01:45.000Z | src/game/client/hl2/energy_wave_effect.cpp | bluedogz162/tf_coop_extended_custom | 0212744ebef4f74c4e0047320d9da7d8571a8ee0 | [
"Unlicense"
] | 3 | 2020-04-24T22:20:36.000Z | 2022-02-21T21:48:05.000Z | //=========== (C) Copyright 2000 Valve, L.L.C. All rights reserved. ===========
//
// Purpose: The EWave effect
//
//=============================================================================
#include "cbase.h"
#include "energy_wave_effect.h"
//-----------------------------------------------------------------------------
// constructor, destructor
//-----------------------------------------------------------------------------
CEnergyWaveEffect::CEnergyWaveEffect( TraceLineFunc_t traceline,
TraceHullFunc_t traceHull ) :
CSheetSimulator(traceline, traceHull)
{
Init(EWAVE_NUM_HORIZONTAL_POINTS, EWAVE_NUM_VERTICAL_POINTS, EWAVE_NUM_CONTROL_POINTS);
}
//-----------------------------------------------------------------------------
// compute rest positions of the springs
//-----------------------------------------------------------------------------
void CEnergyWaveEffect::ComputeRestPositions()
{
int i;
// Set the initial directions and distances (in ewave space)...
for ( i = 0; i < EWAVE_NUM_VERTICAL_POINTS; ++i)
{
// Choose phi centered at pi/2
float phi = (M_PI - m_EWavePhi) * 0.5f + m_EWavePhi *
(float)i / (float)(EWAVE_NUM_VERTICAL_POINTS - 1);
for (int j = 0; j < EWAVE_NUM_HORIZONTAL_POINTS; ++j)
{
// Choose theta centered at pi/2 also (y, or forward axis)
float theta = (M_PI - m_EWaveTheta) * 0.5f + m_EWaveTheta *
(float)j / (float)(EWAVE_NUM_HORIZONTAL_POINTS - 1);
int idx = i * EWAVE_NUM_HORIZONTAL_POINTS + j;
GetFixedPoint(idx).x = cos(theta) * sin(phi) * m_RestDistance;
GetFixedPoint(idx).y = sin(theta) * sin(phi) * m_RestDistance;
GetFixedPoint(idx).z = cos(phi) * m_RestDistance;
}
}
// Compute box for fake volume testing
Vector dist = GetFixedPoint(0) - GetFixedPoint(1);
float l = dist.Length();
Vector v1 = Vector( -l * 0.25f, -l * 0.25f, -l * 0.25f );
Vector v2 = Vector( l * 0.25f, l * 0.25f, l * 0.25f );
SetBoundingBox( v1, v2 );
}
void CEnergyWaveEffect::MakeSpring( int p1, int p2 )
{
Vector dist = GetFixedPoint(p1) - GetFixedPoint(p2);
AddSpring( p1, p2, dist.Length() );
}
void CEnergyWaveEffect::ComputeSprings()
{
// Do the main springs first
// Compute springs and rest lengths...
int i, j;
for ( i = 0; i < EWAVE_NUM_VERTICAL_POINTS; ++i)
{
for ( j = 0; j < EWAVE_NUM_HORIZONTAL_POINTS; ++j)
{
// Here's the particle we're making springs for
int idx = i * EWAVE_NUM_HORIZONTAL_POINTS + j;
// Make a spring connected to the control point
AddFixedPointSpring( idx, idx, 0.0f );
}
}
// Add four corner springs
MakeSpring( 0, 3 );
MakeSpring( 0, 12 );
MakeSpring( 12, 15 );
MakeSpring( 3, 15 );
}
//------------------------------------------------------------------------------
// Purpose : Overwrite. Energy wave does no collisions
// Input :
// Output :
//------------------------------------------------------------------------------
void CEnergyWaveEffect::DetectCollisions()
{
return;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CEnergyWaveEffect::Precache( void )
{
SetFixedSpringConstant( 200.0f );
SetPointSpringConstant( 0.5f );
SetSpringDampConstant( 10.0f );
SetViscousDrag( 0.25f );
m_RestDistance = 500.0;
m_EWaveTheta = M_PI * EWAVE_INITIAL_THETA / 180.0f;
m_EWavePhi = M_PI * EWAVE_INITIAL_PHI / 180.0f;
// Computes the rest positions
ComputeRestPositions();
// Computes the springs
ComputeSprings();
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CEnergyWaveEffect::Spawn( void )
{
Precache();
}
//-----------------------------------------------------------------------------
// Computes the opacity....
//-----------------------------------------------------------------------------
float CEnergyWaveEffect::ComputeOpacity( const Vector& pt, const Vector& center ) const
{
float dist = pt.DistTo( center ) / m_RestDistance;
dist = sqrt(dist);
if (dist > 1.0)
dist = 1.0f;
return (1.0 - dist) * 35;
}
| 29.928571 | 88 | 0.507399 | [
"vector"
] |
c42abcbfab5dfafdf0429668f29edf4ac371dc38 | 3,282 | cc | C++ | slick/test/unittest/geometry_line2d_unittest.cc | williammc/Slick | 67dec11ea252e7e3a7d6097369a0f313cf1d2fdd | [
"BSD-3-Clause"
] | 1 | 2017-04-13T05:26:40.000Z | 2017-04-13T05:26:40.000Z | slick/test/unittest/geometry_line2d_unittest.cc | williammc/Slick | 67dec11ea252e7e3a7d6097369a0f313cf1d2fdd | [
"BSD-3-Clause"
] | null | null | null | slick/test/unittest/geometry_line2d_unittest.cc | williammc/Slick | 67dec11ea252e7e3a7d6097369a0f313cf1d2fdd | [
"BSD-3-Clause"
] | null | null | null | #include <gtest/gtest.h>
#include <Eigen/Geometry>
#include "slick/geometry/line2d.h"
#include "slick/test/unittest/util.h"
const int N = 10;
template <typename T>
void check_on_line(const slick::Line2DBase<T> &line,
const Eigen::Matrix<T, 2, 1> &pt) {
const auto lv = (line.point2() - line.point1()).normalized();
const T t = (pt - line.point1()).normalized().dot(lv);
EXPECT_NEAR(std::fabs(t), 1.0, slick::Gap<T>());
};
// line2d specific functions ===================================================
template <typename T> void Project_Test() {
std::srand(
std::time(nullptr)); // use current time as seed for random generator
slick::Line2DBase<T> line(slick::GenRandPoint2D<T>(N),
slick::GenRandPoint2D<T>(N));
const auto pr = line.project(slick::GenRandPoint2D<T>(N));
const auto lv = (line.point2() - line.point1()).normalized();
const T t = (pr - line.point1()).normalized().dot(lv);
EXPECT_NEAR(std::fabs(t), 1.0, slick::Gap<T>());
}
TEST(Line2DBaseTest, Project) {
Project_Test<double>();
Project_Test<float>();
}
template <typename T> void perpendicular_distance_Test(T gap) {
std::srand(
std::time(nullptr)); // use current time as seed for random generator
slick::Line2DBase<T> line(slick::GenRandPoint2D<T>(N),
slick::GenRandPoint2D<T>(N));
const auto pt = slick::GenRandPoint2D<T>(N);
const auto pr = line.project(pt);
const T t = line.perpendicular_distance(pt);
EXPECT_NEAR(t, (pt - pr).norm(), gap);
}
TEST(Line2DBaseTest, perpendicular_distance) {
perpendicular_distance_Test<double>(slick::Gap<double>());
perpendicular_distance_Test<float>(1.e-3);
}
template <typename T> void perpendicular_sqdistance_Test(T gap) {
std::srand(
std::time(nullptr)); // use current time as seed for random generator
slick::Line2DBase<T> line(slick::GenRandPoint2D<T>(N),
slick::GenRandPoint2D<T>(N));
const auto pt = slick::GenRandPoint2D<T>(N);
const auto pr = line.project(pt);
const T t = line.perpendicular_sqdistance(pt);
EXPECT_NEAR(t, (pt - pr).squaredNorm(), gap);
}
TEST(Line2DBaseTest, perpendicular_sqdistance) {
perpendicular_sqdistance_Test<double>(slick::Gap<double>());
// perpendicular_sqdistance_Test<float>(1.e-3);
}
template <typename T> void intersect_line_Test() {
std::srand(
std::time(nullptr)); // use current time as seed for random generator
slick::Line2DBase<T> line1(slick::GenRandPoint2D<T>(N),
slick::GenRandPoint2D<T>(N));
slick::Line2DBase<T> line2(slick::GenRandPoint2D<T>(N),
slick::GenRandPoint2D<T>(N));
auto pt = line1.intersect(line2);
if (pt) {
check_on_line(line1, *pt);
check_on_line(line1, *pt);
check_on_line(line2, *pt);
check_on_line(line2, *pt);
}
}
TEST(Line2DBaseTest, intersect_line) {
intersect_line_Test<double>();
intersect_line_Test<float>();
}
int main(int argc, char **argv) {
std::vector<char *> vars(argc + 1);
for (int i = 0; i < argc; ++i)
vars[i] = argv[i];
char ca[50];
sprintf(ca, "--gtest_repeat=%d", NSAMPLES);
vars[argc] = ca;
argc++;
::testing::InitGoogleTest(&argc, &vars.front());
return RUN_ALL_TESTS();
}
| 33.835052 | 80 | 0.640463 | [
"geometry",
"vector"
] |
c43638f82783bc08bf0617a888dbc5816839d39c | 6,555 | cpp | C++ | libraries/entities/src/TextEntityItem.cpp | ey6es/hifi | 23f9c799dde439e4627eef45341fb0d53feff80b | [
"Apache-2.0"
] | null | null | null | libraries/entities/src/TextEntityItem.cpp | ey6es/hifi | 23f9c799dde439e4627eef45341fb0d53feff80b | [
"Apache-2.0"
] | null | null | null | libraries/entities/src/TextEntityItem.cpp | ey6es/hifi | 23f9c799dde439e4627eef45341fb0d53feff80b | [
"Apache-2.0"
] | null | null | null | //
// TextEntityItem.cpp
// libraries/entities/src
//
// Created by Brad Hefta-Gaub on 12/4/13.
// Copyright 2013 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <glm/gtx/transform.hpp>
#include <QDebug>
#include <ByteCountCoding.h>
#include <PlaneShape.h>
#include "EntityTree.h"
#include "EntityTreeElement.h"
#include "TextEntityItem.h"
const QString TextEntityItem::DEFAULT_TEXT("");
const float TextEntityItem::DEFAULT_LINE_HEIGHT = 0.1f;
const xColor TextEntityItem::DEFAULT_TEXT_COLOR = { 255, 255, 255 };
const xColor TextEntityItem::DEFAULT_BACKGROUND_COLOR = { 0, 0, 0};
EntityItem* TextEntityItem::factory(const EntityItemID& entityID, const EntityItemProperties& properties) {
EntityItem* result = new TextEntityItem(entityID, properties);
return result;
}
TextEntityItem::TextEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
EntityItem(entityItemID)
{
_type = EntityTypes::Text;
_created = properties.getCreated();
setProperties(properties);
}
void TextEntityItem::setDimensions(const glm::vec3& value) {
// NOTE: Text Entities always have a "depth" of 1cm.
float fixedDepth = 0.01f / (float)TREE_SCALE;
_dimensions = glm::vec3(value.x, value.y, fixedDepth);
recalculateCollisionShape();
}
EntityItemProperties TextEntityItem::getProperties() const {
EntityItemProperties properties = EntityItem::getProperties(); // get the properties from our base class
COPY_ENTITY_PROPERTY_TO_PROPERTIES(text, getText);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(lineHeight, getLineHeight);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(textColor, getTextColorX);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(backgroundColor, getBackgroundColorX);
return properties;
}
bool TextEntityItem::setProperties(const EntityItemProperties& properties) {
bool somethingChanged = false;
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
SET_ENTITY_PROPERTY_FROM_PROPERTIES(text, setText);
SET_ENTITY_PROPERTY_FROM_PROPERTIES(lineHeight, setLineHeight);
SET_ENTITY_PROPERTY_FROM_PROPERTIES(textColor, setTextColor);
SET_ENTITY_PROPERTY_FROM_PROPERTIES(backgroundColor, setBackgroundColor);
if (somethingChanged) {
bool wantDebug = false;
if (wantDebug) {
uint64_t now = usecTimestampNow();
int elapsed = now - getLastEdited();
qDebug() << "TextEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
"now=" << now << " getLastEdited()=" << getLastEdited();
}
setLastEdited(properties._lastEdited);
}
return somethingChanged;
}
int TextEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData) {
int bytesRead = 0;
const unsigned char* dataAt = data;
READ_ENTITY_PROPERTY_STRING(PROP_TEXT, setText);
READ_ENTITY_PROPERTY(PROP_LINE_HEIGHT, float, _lineHeight);
READ_ENTITY_PROPERTY_COLOR(PROP_TEXT_COLOR, _textColor);
READ_ENTITY_PROPERTY_COLOR(PROP_BACKGROUND_COLOR, _backgroundColor);
return bytesRead;
}
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
EntityPropertyFlags TextEntityItem::getEntityProperties(EncodeBitstreamParams& params) const {
EntityPropertyFlags requestedProperties = EntityItem::getEntityProperties(params);
requestedProperties += PROP_TEXT;
requestedProperties += PROP_LINE_HEIGHT;
requestedProperties += PROP_TEXT_COLOR;
requestedProperties += PROP_BACKGROUND_COLOR;
return requestedProperties;
}
void TextEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,
EntityPropertyFlags& propertiesDidntFit,
int& propertyCount,
OctreeElement::AppendState& appendState) const {
bool successPropertyFits = true;
APPEND_ENTITY_PROPERTY(PROP_TEXT, appendValue, getText());
APPEND_ENTITY_PROPERTY(PROP_LINE_HEIGHT, appendValue, getLineHeight());
APPEND_ENTITY_PROPERTY(PROP_TEXT_COLOR, appendColor, getTextColor());
APPEND_ENTITY_PROPERTY(PROP_BACKGROUND_COLOR, appendColor, getBackgroundColor());
}
bool TextEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
bool& keepSearching, OctreeElement*& element, float& distance, BoxFace& face,
void** intersectedObject, bool precisionPicking) const {
RayIntersectionInfo rayInfo;
rayInfo._rayStart = origin;
rayInfo._rayDirection = direction;
rayInfo._rayLength = std::numeric_limits<float>::max();
PlaneShape plane;
const glm::vec3 UNROTATED_NORMAL(0.0f, 0.0f, -1.0f);
glm::vec3 normal = _rotation * UNROTATED_NORMAL;
plane.setNormal(normal);
plane.setPoint(_position); // the position is definitely a point on our plane
bool intersects = plane.findRayIntersection(rayInfo);
if (intersects) {
glm::vec3 hitAt = origin + (direction * rayInfo._hitDistance);
// now we know the point the ray hit our plane
glm::mat4 rotation = glm::mat4_cast(getRotation());
glm::mat4 translation = glm::translate(getPosition());
glm::mat4 entityToWorldMatrix = translation * rotation;
glm::mat4 worldToEntityMatrix = glm::inverse(entityToWorldMatrix);
glm::vec3 dimensions = getDimensions();
glm::vec3 registrationPoint = getRegistrationPoint();
glm::vec3 corner = -(dimensions * registrationPoint);
AABox entityFrameBox(corner, dimensions);
glm::vec3 entityFrameHitAt = glm::vec3(worldToEntityMatrix * glm::vec4(hitAt, 1.0f));
intersects = entityFrameBox.contains(entityFrameHitAt);
}
if (intersects) {
distance = rayInfo._hitDistance;
}
return intersects;
}
| 39.017857 | 110 | 0.70389 | [
"transform"
] |
c443d408ca6f1e0f4400f59d95987c8a84786829 | 622 | hpp | C++ | libs/core/font/include/bksge/core/font/otf/cff2.hpp | myoukaku/bksge | 0f8b60e475a3f1709723906e4796b5e60decf06e | [
"MIT"
] | 4 | 2018-06-10T13:35:32.000Z | 2021-06-03T14:27:41.000Z | libs/core/font/include/bksge/core/font/otf/cff2.hpp | myoukaku/bksge | 0f8b60e475a3f1709723906e4796b5e60decf06e | [
"MIT"
] | 566 | 2017-01-31T05:36:09.000Z | 2022-02-09T05:04:37.000Z | libs/core/font/include/bksge/core/font/otf/cff2.hpp | myoukaku/bksge | 0f8b60e475a3f1709723906e4796b5e60decf06e | [
"MIT"
] | 1 | 2018-07-05T04:40:53.000Z | 2018-07-05T04:40:53.000Z | /**
* @file cff2.hpp
*
* @brief CompactFontFormat2Table の定義
*
* @author myoukaku
*/
#ifndef BKSGE_CORE_FONT_OTF_CFF2_HPP
#define BKSGE_CORE_FONT_OTF_CFF2_HPP
#include <bksge/core/font/otf/read_big_endian.hpp>
#include <bksge/core/font/otf/types.hpp>
#include <cstdint>
#include <vector>
namespace bksge
{
namespace otf
{
struct CompactFontFormat2Table
{
explicit CompactFontFormat2Table(std::uint8_t const* ptr, uint32 length)
: m_buf(ptr, ptr + length)
{}
std::vector<uint8> m_buf;
};
} // namespace otf
} // namespace bksge
#endif // BKSGE_CORE_FONT_OTF_CFF2_HPP
| 16.810811 | 74 | 0.697749 | [
"vector"
] |
c45acd7aa76a1cfb9330c77324b63f3775c83deb | 4,054 | hpp | C++ | modules/cdm_gtest.hpp | TyRoXx/cdm | 758cb59106c6acdc987b6f859387db2398415127 | [
"MIT"
] | 4 | 2015-11-01T20:41:55.000Z | 2021-08-04T00:49:37.000Z | modules/cdm_gtest.hpp | TyRoXx/cdm | 758cb59106c6acdc987b6f859387db2398415127 | [
"MIT"
] | 1 | 2015-10-29T21:33:53.000Z | 2015-10-29T21:33:53.000Z | modules/cdm_gtest.hpp | TyRoXx/cdm | 758cb59106c6acdc987b6f859387db2398415127 | [
"MIT"
] | 1 | 2021-08-04T00:49:38.000Z | 2021-08-04T00:49:38.000Z | #ifndef CDM_GTEST_HPP
#define CDM_GTEST_HPP
#include <ventura/file_operations.hpp>
#include <ventura/run_process.hpp>
#include <silicium/sink/iterator_sink.hpp>
#include <cdm/cmake_generator.hpp>
namespace cdm
{
struct gtest_paths
{
ventura::absolute_path include;
ventura::absolute_path library;
ventura::absolute_path library_main;
};
namespace gtest
{
inline ventura::relative_path make_static_lib_install_path(ventura::path_segment const &name_base)
{
#ifdef _WIN32
return ventura::relative_path(name_base + *ventura::path_segment::create(".lib"));
#else
return ventura::relative_path("lib" + name_base.underlying() + ".a");
#endif
}
}
inline gtest_paths install_gtest(ventura::absolute_path const >est_source,
ventura::absolute_path const &temporarily_writable,
ventura::absolute_path const &install_root,
ventura::absolute_path const &cmake_exe, cdm::configuration const &target,
Si::Sink<char, Si::success>::interface &output)
{
ventura::absolute_path const gtest_in_cache = install_root / "gtest";
if (!ventura::file_exists(gtest_in_cache, Si::throw_))
{
ventura::absolute_path const build_dir = temporarily_writable / "build";
ventura::create_directories(build_dir, Si::throw_);
{
std::vector<Si::noexcept_string> arguments;
#ifdef _MSC_VER
arguments.emplace_back("-DBUILD_SHARED_LIBS=OFF");
arguments.emplace_back("-Dgtest_force_shared_crt=ON");
#endif
cdm::generate_default_cmake_generator_arguments(Si::make_container_sink(arguments), target);
arguments.emplace_back(ventura::to_utf8_string(gtest_source));
int rc = ventura::run_process(cmake_exe, arguments, build_dir, output,
std::vector<std::pair<Si::os_char const *, Si::os_char const *>>(),
ventura::environment_inheritance::inherit)
.get();
if (rc != 0)
{
throw std::runtime_error("cmake configure failed");
}
}
{
std::vector<Si::noexcept_string> arguments;
cdm::generate_cmake_build_arguments(Si::make_container_sink(arguments), target);
int rc = ventura::run_process(cmake_exe, arguments, build_dir, output,
std::vector<std::pair<Si::os_char const *, Si::os_char const *>>(),
ventura::environment_inheritance::inherit)
.get();
if (rc != 0)
{
throw std::runtime_error("cmake build failed");
}
}
ventura::absolute_path const construction_site = temporarily_writable / "construction";
ventura::create_directories(construction_site, Si::throw_);
{
ventura::absolute_path const lib_dir = construction_site / "lib";
ventura::create_directories(lib_dir, Si::throw_);
ventura::copy(build_dir / cdm::make_default_path_of_static_library(
*ventura::path_segment::create("gtest"), target),
lib_dir / gtest::make_static_lib_install_path(*ventura::path_segment::create("gtest")),
Si::throw_);
ventura::copy(
build_dir /
cdm::make_default_path_of_static_library(*ventura::path_segment::create("gtest_main"), target),
lib_dir / gtest::make_static_lib_install_path(*ventura::path_segment::create("gtest_main")),
Si::throw_);
ventura::copy_recursively(gtest_source / "include", construction_site / "include", &output, Si::throw_);
}
ventura::create_directories(install_root, Si::throw_);
ventura::rename(construction_site, gtest_in_cache, Si::throw_);
}
gtest_paths result;
result.include = gtest_in_cache / "include";
auto lib_dir = gtest_in_cache / "lib";
result.library = lib_dir / gtest::make_static_lib_install_path(*ventura::path_segment::create("gtest"));
result.library_main =
lib_dir / gtest::make_static_lib_install_path(*ventura::path_segment::create("gtest_main"));
return result;
}
}
#endif
| 40.54 | 108 | 0.670696 | [
"vector"
] |
c4678bf51c8dfdf8d71bce0215c8b1e85f594081 | 3,672 | cpp | C++ | libpolycrypto/bench/BenchAMT.cpp | ibalajiarun/libpolycrypto | 89a69ed90ee4e9287222cc5781ff11562286f454 | [
"MIT"
] | 25 | 2020-01-29T19:33:48.000Z | 2022-03-28T16:45:51.000Z | libpolycrypto/bench/BenchAMT.cpp | ibalajiarun/libpolycrypto | 89a69ed90ee4e9287222cc5781ff11562286f454 | [
"MIT"
] | 2 | 2020-03-18T12:33:27.000Z | 2020-03-18T18:30:55.000Z | libpolycrypto/bench/BenchAMT.cpp | ibalajiarun/libpolycrypto | 89a69ed90ee4e9287222cc5781ff11562286f454 | [
"MIT"
] | 8 | 2020-07-09T01:35:42.000Z | 2021-07-20T04:54:47.000Z | #include <polycrypto/PolyOps.h>
#include <polycrypto/PolyCrypto.h>
#include <polycrypto/RootsOfUnityEval.h>
#include <polycrypto/Utils.h>
#include <vector>
#include <cmath>
#include <iostream>
#include <ctime>
#include <fstream>
#include <xutils/Log.h>
#include <xutils/Timer.h>
#include <xassert/XAssert.h>
using namespace std;
using namespace libfqfft;
using namespace libpolycrypto;
void logMemUsage() {
size_t vms, rss;
getMemUsage(vms, rss);
logperf << "VMS: " << Utils::humanizeBytes(vms) << endl;
logperf << "RSS: " << Utils::humanizeBytes(rss) << endl;
logperf << endl;
}
int main(int argc, char *argv[]) {
libpolycrypto::initialize(nullptr, 0);
if(argc < 5) {
cout << "Usage: " << argv[0] << "<t> <n> <r>" << endl;
cout << endl;
cout << "OPTIONS: " << endl;
cout << " <pp-file> the Kate public parameters file" << endl;
cout << " <t> the degree of the evaluated polynomial + 1" << endl;
cout << " <n> the # of points to evaluate at (i.e., # of AMT leaves)" << endl;
cout << " <r> the # of times to repeat the AMT auth + verif" << endl;
cout << endl;
return 1;
}
std::string ppFile = argv[1];
size_t t = static_cast<size_t>(std::stoi(argv[2]));
size_t n = static_cast<size_t>(std::stoi(argv[3]));
size_t r = static_cast<size_t>(std::stoi(argv[4]));
std::unique_ptr<Dkg::KatePublicParameters> kpp(
new Dkg::KatePublicParameters(ppFile, t-1));
loginfo << "Degree t = " << t - 1 << " poly, evaluated at n = " << n << " points, iters = " << r << endl;
AveragingTimer at("Accum tree");
at.startLap();
AccumulatorTree accs(n);
auto mus = at.endLap();
logperf << " - AccumulatorTree: " << Utils::humanizeMicroseconds(mus, 2) << endl;
// NOTE: Uncomment this to see beautiful roots-of-unity structure
//std::cout << "Accumulator tree for n = " << n << endl;
//std::cout << accs.toString() << endl;
std::vector<Fr> f = random_field_elems(t);
// Step 1: Fast multipoint eval
AveragingTimer c1("Roots-of-unity eval ");
c1.startLap();
RootsOfUnityEvaluation eval(f, accs);
std::vector<Fr> evals = eval.getEvaluations();
mus = c1.endLap();
logperf << " - Roots of unity eval: " << Utils::humanizeMicroseconds(mus, 2) << endl;
// Step 2: Authenticate AccumulatorTree
AveragingTimer aat("Auth accum tree");
aat.startLap();
AuthAccumulatorTree authAccs(accs, *kpp, t);
mus = aat.endLap();
logperf << " - AuthAccumulatorTree: " << Utils::humanizeMicroseconds(mus, 2) << endl;
// Step 3: Authenticate Multipoint Evaluation
AveragingTimer ars("Auth roots-of-unity eval (simulated)");
for(size_t i = 0; i < r; i++) {
ars.startLap();
AuthRootsOfUnityEvaluation authEval(eval, *kpp, true);
mus = ars.endLap();
logperf << " - AuthRootsOfUnityEval simulated (iter " << i << "): " << Utils::humanizeMicroseconds(mus, 2) << endl;
}
AveragingTimer ar("Auth roots-of-unity eval");
for(size_t i = 0; i < r; i++) {
ar.startLap();
AuthRootsOfUnityEvaluation authEval(eval, *kpp, false);
mus = ar.endLap();
logperf << " - AuthRootsOfUnityEval (iter " << i << "): " << Utils::humanizeMicroseconds(mus, 2) << endl;
}
logperf << endl;
logperf << at << endl;
logperf << c1 << endl;
logperf << aat << endl;
logperf << ar << endl;
logperf << ars << endl;
logperf << endl;
// Step 4: Verify AMT proofs (TODO: implement)
loginfo << "Exited succsessfully!" << endl;
return 0;
}
| 31.655172 | 123 | 0.594499 | [
"vector"
] |
c47663ccdb3c0c25259c9f2e04f7c0402cd881f7 | 2,723 | hh | C++ | src/include/uDepot/net.hh | nik-io/uDepot | 06b94b7f2438b38b46572ede28072e24997e40c6 | [
"BSD-3-Clause"
] | null | null | null | src/include/uDepot/net.hh | nik-io/uDepot | 06b94b7f2438b38b46572ede28072e24997e40c6 | [
"BSD-3-Clause"
] | null | null | null | src/include/uDepot/net.hh | nik-io/uDepot | 06b94b7f2438b38b46572ede28072e24997e40c6 | [
"BSD-3-Clause"
] | null | null | null | /*
* Copyright (c) 2020 International Business Machines
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
* Authors: Nikolas Ioannou (nio@zurich.ibm.com),
* Kornilios Kourtis (kou@zurich.ibm.com, kornilios@gmail.com)
*
*/
#ifndef _UDEPOT_NET_HH_
#define _UDEPOT_NET_HH_
#include <vector>
#include <set>
#include "uDepot/net/concepts.hh"
#include "kv-mbuff.hh"
#include "util/socket-peer-conf.hh"
namespace udepot {
// Common part for uDepot networking.
template<typename Net>
class uDepotNet {
using Srv = typename Net::Server;
using Cli = typename Net::Client;
const std::vector<typename Cli::Conf> client_confs_m; // client confs
typename Srv::Conf server_conf_m; // server configuration
Net base_m; // net instance
Srv server_m; // server instance
std::vector<std::vector<Cli *>> conn_m;
std::vector<std::vector<Cli *>> consistent_hash_m;
KV_MbuffInterface &kv_mbuff_m;
void setup_consistent_hash_map(void);
__attribute__((warn_unused_result)) int init_socket_key_value_client(void);
int stop_clients(void);
int stop_server(void);
int clear();
bool is_needed() {
return (server_conf_m.is_valid() || client_confs_m.size() > 0);
}
public:
// NB: the kv_mbuff is passed to the server and clients:
// server uses it to serve requests
// clients may use it for buffer allocation on mbuffs
uDepotNet(uint32_t thread_nr,
std::vector<typename Cli::Conf> client_confs,
typename Srv::Conf server_conf,
KV_MbuffInterface &kv_mbuff);
int global_init(void) { return base_m.global_init(); }
int thread_init(void) {
return is_needed() ? base_m.thread_init() : 0;
}
int thread_exit(void) {
return is_needed() ? base_m.thread_exit() : 0;
}
int global_exit(void) { return base_m.global_exit(); }
__attribute__((warn_unused_result)) int start_net_all(void);
int stop_net_all(void);
public:
// Retrieve a client based on the key hash and the tid
//
// Returns a client that can be used for operations, or NULL if the
// operation needs to be performed locally.
Cli *get_client(uint64_t h, uint32_t tid) {
if (consistent_hash_m[tid].size() == 0)
return nullptr;
const u32 idx = h % (consistent_hash_m[tid].size());
return get_scd(tid, idx);
}
private:
Cli *get_scd(const u32 tid, const u32 idx) const {
return tid < consistent_hash_m.size()
? (idx < consistent_hash_m[tid].size() ? consistent_hash_m[tid][idx] : nullptr)
: nullptr;
}
};
} // end namespace udepot
#endif /* ifndef _UDEPOT_NET_HH_ */
| 28.663158 | 83 | 0.662137 | [
"vector"
] |
c4766d0e2910bd1c46ab4edf0e2316b3252c69b2 | 9,785 | cpp | C++ | tactical_wildfire_management/src/twm/Problem.cpp | XanX3601/stochastic_mcts_optimization | 743ef3df090427750fee55fd69d7646a88d5946a | [
"Apache-2.0"
] | null | null | null | tactical_wildfire_management/src/twm/Problem.cpp | XanX3601/stochastic_mcts_optimization | 743ef3df090427750fee55fd69d7646a88d5946a | [
"Apache-2.0"
] | null | null | null | tactical_wildfire_management/src/twm/Problem.cpp | XanX3601/stochastic_mcts_optimization | 743ef3df090427750fee55fd69d7646a88d5946a | [
"Apache-2.0"
] | null | null | null | #include <twm/Problem.h>
#include <algorithm>
#include <random>
#include <stdexcept>
#include <unordered_map>
#include <vector>
#include "twm/Action.h"
void twm::Problem::init_legal_actions() {
int cell_count = get_cell_count();
legal_actions = std::vector<twm::Action>(cell_count + 1);
for (int cell_index = 0; cell_index < cell_count; ++cell_index) {
legal_actions[cell_index] = twm::Action(index_to_cell(cell_index));
}
legal_actions[cell_count] = twm::Action::null_action;
}
twm::Problem::Problem(int grid_width, int grid_height)
: grid_width(grid_width), grid_height(grid_height) {
int cell_count = get_cell_count();
each_cell_initial_fuel_amount = std::vector<int>(cell_count, 0);
is_each_cell_initially_burning = std::vector<bool>(cell_count, false);
each_cell_ignition_probabilities =
std::vector<std::vector<double>>(cell_count, std::vector<double>(cell_count, 0));
each_cell_extinguishment_probability = std::vector<double>(cell_count, 0);
each_cell_burning_reward = std::vector<int>(cell_count, -1);
init_random_bitstrings();
init_legal_actions();
}
twm::Problem::Problem(int grid_width, int grid_height,
const std::vector<int>& each_cell_initial_fuel_amount,
const std::vector<bool>& is_each_cell_initially_burning,
const std::vector<std::vector<double>>& each_cell_ignition_probabilities,
const std::vector<double>& each_cell_extinguishment_probability,
const std::vector<int> each_cell_burning_reward, int team_count)
: grid_width(grid_width),
grid_height(grid_height),
each_cell_initial_fuel_amount(each_cell_initial_fuel_amount),
is_each_cell_initially_burning(is_each_cell_initially_burning),
each_cell_ignition_probabilities(each_cell_ignition_probabilities),
each_cell_extinguishment_probability(each_cell_extinguishment_probability),
each_cell_burning_reward(each_cell_burning_reward),
team_count(team_count) {
init_random_bitstrings();
init_legal_actions();
}
twm::Problem::Problem(int grid_width, int grid_height,
const std::vector<int>& each_cell_initial_fuel_amount,
const std::vector<bool>& is_each_cell_initially_burning,
double neighbors_ignition_probability,
const std::vector<double>& each_cell_extinguishment_probability,
const std::vector<int> each_cell_burning_reward, int team_count)
: grid_width(grid_width),
grid_height(grid_height),
each_cell_initial_fuel_amount(each_cell_initial_fuel_amount),
is_each_cell_initially_burning(is_each_cell_initially_burning),
each_cell_extinguishment_probability(each_cell_extinguishment_probability),
each_cell_burning_reward(each_cell_burning_reward),
team_count(team_count) {
int cell_count = get_cell_count();
each_cell_ignition_probabilities = std::vector<std::vector<double>>(cell_count);
for (int x = 0; x < grid_width; ++x) {
for (int y = 0; y < grid_height; ++y) {
twm::Cell cell(x, y);
int cell_index = cell_to_index(cell);
each_cell_ignition_probabilities[cell_index] = std::vector<double>(cell_count, 0);
for (int other_x = 0; other_x < grid_width; ++other_x) {
for (int other_y = 0; other_y < grid_height; ++other_y) {
twm::Cell other_cell(other_x, other_y);
int other_cell_index = cell_to_index(other_cell);
if (cell == other_cell) {
each_cell_ignition_probabilities[cell_index][other_cell_index] = 1;
} else if (cell.is_neighbor(other_cell)) {
each_cell_ignition_probabilities[cell_index][other_cell_index] =
neighbors_ignition_probability;
}
}
}
}
}
init_random_bitstrings();
init_legal_actions();
}
int twm::Problem::cell_to_index(const twm::Cell& cell) const {
return cell.y * grid_width + cell.x;
}
twm::Cell twm::Problem::index_to_cell(int cell_index) const {
return twm::Cell(cell_index % grid_width, cell_index / grid_width);
}
bool twm::Problem::is_in_grid(const twm::Cell& cell) const {
return 0 <= cell.x && cell.x < grid_width && 0 <= cell.y && cell.y < grid_height;
}
int twm::Problem::get_grid_width() const { return grid_width; }
int twm::Problem::get_grid_height() const { return grid_height; }
int twm::Problem::get_cell_count() const { return grid_width * grid_height; }
int twm::Problem::get_cell_initial_fuel_amount(const twm::Cell& cell) const {
return get_cell_initial_fuel_amount(cell_to_index(cell));
}
int twm::Problem::get_cell_initial_fuel_amount(int cell_index) const {
return each_cell_initial_fuel_amount[cell_index];
}
bool twm::Problem::is_cell_initially_burning(const twm::Cell& cell) const {
return is_cell_initially_burning(cell_to_index(cell));
}
bool twm::Problem::is_cell_initially_burning(int cell_index) const {
return is_each_cell_initially_burning[cell_index];
}
double twm::Problem::get_probability_that_y_ignites_x(const twm::Cell& x,
const twm::Cell& y) const {
return get_probability_that_y_ignites_x(cell_to_index(x), cell_to_index(y));
}
double twm::Problem::get_probability_that_y_ignites_x(int x_index, int y_index) const {
return each_cell_ignition_probabilities[x_index][y_index];
}
double twm::Problem::get_probability_to_extinguish_cell(const twm::Cell& cell) const {
return get_probability_to_extinguish_cell(cell_to_index(cell));
}
double twm::Problem::get_probability_to_extinguish_cell(int cell_index) const {
return each_cell_extinguishment_probability[cell_index];
}
int twm::Problem::get_cell_burning_reward(const twm::Cell& cell) const {
return get_cell_burning_reward(cell_to_index(cell));
}
int twm::Problem::get_cell_burning_reward(int cell_index) const {
return each_cell_burning_reward[cell_index];
}
int twm::Problem::get_team_count() const { return team_count; }
void twm::Problem::init_random_bitstrings() {
std::random_device rd;
std::mt19937_64 gen(rd());
std::uniform_int_distribution<unsigned long long> dis;
for (int cell_index = 0; cell_index < get_cell_count(); ++cell_index) {
each_cell_fuel_random_bitstrings[cell_index] =
std::vector<unsigned long long>(get_cell_initial_fuel_amount(cell_index) + 1);
for (int fuel_amount = 0; fuel_amount < get_cell_initial_fuel_amount(cell_index) + 1;
++fuel_amount) {
each_cell_fuel_random_bitstrings[cell_index][fuel_amount] = dis(gen);
}
each_cell_burning_random_bitstrings[cell_index] = std::vector<unsigned long long>(2);
for (int is_cell_burning = 0; is_cell_burning < 2; ++is_cell_burning) {
each_cell_burning_random_bitstrings[cell_index][is_cell_burning] = dis(gen);
}
each_cell_team_random_bitstrings[cell_index] =
std::vector<unsigned long long>(get_team_count());
for (int team_index = 0; team_index < get_team_count(); ++team_index) {
each_cell_team_random_bitstrings[cell_index][team_index] = dis(gen);
}
}
int null_cell_index = cell_to_index(twm::Cell::null_cell);
each_cell_team_random_bitstrings[null_cell_index] =
std::vector<unsigned long long>(get_team_count());
for (int team_index = 0; team_index < get_team_count(); ++team_index) {
each_cell_team_random_bitstrings[null_cell_index][team_index] = dis(gen);
}
each_team_turn_random_bitstrings = std::vector<unsigned long long>(get_team_count());
for (int team_index = 0; team_index < get_team_count(); ++team_index) {
each_team_turn_random_bitstrings[team_index] = dis(gen);
}
}
unsigned long long twm::Problem::get_cell_fuel_random_bitstring(const twm::Cell& cell,
int fuel_amount) const {
return get_cell_fuel_random_bitstring(cell_to_index(cell), fuel_amount);
}
unsigned long long twm::Problem::get_cell_fuel_random_bitstring(int cell_index,
int fuel_amount) const {
return each_cell_fuel_random_bitstrings.at(cell_index)[fuel_amount];
}
unsigned long long twm::Problem::get_cell_burning_random_bitstring(const twm::Cell& cell,
bool is_cell_burning) const {
return get_cell_burning_random_bitstring(cell_to_index(cell), is_cell_burning);
}
unsigned long long twm::Problem::get_cell_burning_random_bitstring(int cell_index,
bool is_cell_burning) const {
return each_cell_burning_random_bitstrings.at(cell_index)[is_cell_burning];
}
unsigned long long twm::Problem::get_cell_team_random_bitstring(const twm::Cell& cell,
int team_index) const {
return get_cell_team_random_bitstring(cell_to_index(cell), team_index);
}
unsigned long long twm::Problem::get_cell_team_random_bitstring(int cell_index,
int team_index) const {
return each_cell_team_random_bitstrings.at(cell_index)[team_index];
}
unsigned long long twm::Problem::get_team_turn_random_bitstring(int team_index) const {
return each_team_turn_random_bitstrings[team_index];
}
const std::vector<twm::Action>& twm::Problem::get_legal_actions() const { return legal_actions; }
| 42.176724 | 97 | 0.685641 | [
"vector"
] |
c48102f425a9407dc74c13b39dfeff0272976463 | 2,011 | cpp | C++ | ares/sg/system/system.cpp | moon-chilled/Ares | 909fb098c292f8336d0502dc677050312d8b5c81 | [
"0BSD"
] | 7 | 2020-07-25T11:44:39.000Z | 2021-01-29T13:21:31.000Z | ares/sg/system/system.cpp | jchw-forks/ares | d78298a1e95fd0ce65feabfd4f13b60e31210a7a | [
"0BSD"
] | null | null | null | ares/sg/system/system.cpp | jchw-forks/ares | d78298a1e95fd0ce65feabfd4f13b60e31210a7a | [
"0BSD"
] | 1 | 2021-03-22T16:15:30.000Z | 2021-03-22T16:15:30.000Z | #include <sg/sg.hpp>
namespace ares::SG1000 {
Scheduler scheduler;
System system;
#include "controls.cpp"
#include "serialization.cpp"
auto System::run() -> void {
if(scheduler.enter() == Event::Frame) {
vdp.refresh();
controls.poll();
}
}
auto System::load(Node::Object& root) -> void {
if(node) unload();
information = {};
if(interface->name() == "SG-1000") information.model = Model::SG1000;
if(interface->name() == "SC-3000") information.model = Model::SC3000;
node = Node::System::create(interface->name());
root = node;
regionNode = node->append<Node::String>("Region", "NTSC → PAL");
regionNode->setAllowedValues({
"NTSC → PAL",
"PAL → NTSC",
"NTSC",
"PAL"
});
scheduler.reset();
controls.load(node);
cpu.load(node);
vdp.load(node);
psg.load(node);
cartridgeSlot.load(node);
controllerPort1.load(node);
controllerPort2.load(node);
}
auto System::save() -> void {
if(!node) return;
cartridge.save();
}
auto System::unload() -> void {
if(!node) return;
save();
cpu.unload();
vdp.unload();
psg.unload();
cartridgeSlot.unload();
controllerPort1.unload();
controllerPort2.unload();
node = {};
}
auto System::power() -> void {
for(auto& setting : node->find<Node::Setting>()) setting->setLatch();
auto setRegion = [&](string region) {
if(region == "NTSC") {
information.region = Region::NTSC;
information.colorburst = Constants::Colorburst::NTSC;
}
if(region == "PAL") {
information.region = Region::PAL;
information.colorburst = Constants::Colorburst::PAL * 4.0 / 5.0;
}
};
auto regionsHave = regionNode->latch().split("→").strip();
setRegion(regionsHave.first());
for(auto& have : reverse(regionsHave)) {
if(have == cartridge.region()) setRegion(have);
}
cartridge.power();
cpu.power();
vdp.power();
psg.power();
scheduler.power(cpu);
information.serializeSize[0] = serializeInit(0);
information.serializeSize[1] = serializeInit(1);
}
}
| 21.858696 | 71 | 0.632521 | [
"object",
"model"
] |
c4849cb5b0ef088ca3ceb4d0d068009d7a73088c | 1,614 | cpp | C++ | cf/1178/f.cpp | tusikalanse/acm-icpc | 20150f42752b85e286d812e716bb32ae1fa3db70 | [
"MIT"
] | 2 | 2021-06-09T12:27:07.000Z | 2021-06-11T12:02:03.000Z | cf/1178/f.cpp | tusikalanse/acm-icpc | 20150f42752b85e286d812e716bb32ae1fa3db70 | [
"MIT"
] | 1 | 2021-09-08T12:00:05.000Z | 2021-09-08T14:52:30.000Z | cf/1178/f.cpp | tusikalanse/acm-icpc | 20150f42752b85e286d812e716bb32ae1fa3db70 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int N = 1e6 + 10, mod = 998244353, M = 1010;
int a[N];
int n, m;
int f[M][M], mx[M], mn[M];
vector<int> d;
vector<int> C[M];
int main() {
scanf("%d%d", &n, &m);
d.push_back(-1);
for(int i = 1; i <= m; ++i) {
scanf("%d", &a[i]);
if(d.empty() || d.back() != a[i]) d.push_back(a[i]);
}
m = d.size() - 1;
if(m > 2 * n + 1) {
puts("0");
return 0;
}
memset(mn, -1, sizeof(mn));
for(int i = 1; i <= m; ++i) {
if(mn[d[i]] == -1)
mn[d[i]] = i;
mx[d[i]] = i;
C[d[i]].push_back(i);
}
for(int i = 1; i <= n; ++i) {
bool flag = false;
for(int j = mn[i]; j <= mx[i]; ++j) {
if(d[j] < i)
flag = true;
if(d[j] == i && flag) {
puts("0");
return 0;
}
}
}
for(int i = 1; i <= m; ++i) f[i][i] = d[i];
for(int i = 1; i <= m; ++i)
for(int j = i + 1; j <= m; ++j)
f[i][j] = min(f[i][j - 1], f[j][j]);
vector<vector<int>> dp(m + 2, vector<int>(m + 2, 1));
for(int len = 1; len <= m; ++len) {
for(int l = 1, r = l + len - 1; r <= m; ++l, ++r) {
int c = f[l][r];
if(l > mn[c] || r < mx[c]) {
dp[l][r] = 0;
continue;
}
int left = 0, right = 0;
for(int i = l; i <= mn[c]; ++i) {
left = (left + 1LL * dp[l][i - 1] * dp[i][mn[c] - 1] % mod) % mod;
}
for(int j = mx[c]; j <= r; ++j) {
right = (right + 1LL * dp[mx[c] + 1][j] * dp[j + 1][r] % mod) % mod;
}
dp[l][r] = 1LL * left * right % mod;
for(int i = 0; i + 1 < C[c].size(); ++i)
dp[l][r] = 1LL * dp[l][r] * dp[C[c][i] + 1][C[c][i + 1] - 1] % mod;
}
}
printf("%d\n", dp[1][m]);
return 0;
}
| 22.732394 | 72 | 0.420694 | [
"vector"
] |
c4870a64d65fb2d758976021c20a02782767ef49 | 4,396 | cc | C++ | engine/source/platform/Tickable.cc | itsasc/Necromantia | f41dfa045eb2c3500320767553d75f83df10e6f9 | [
"MIT"
] | 312 | 2015-02-17T15:07:28.000Z | 2022-03-12T07:09:56.000Z | src/platform/Tickable.cc | lukaspj/Torque6 | db6cd08f18f4917e0c6557b2766fb40d8e2bee39 | [
"MIT"
] | 23 | 2015-03-30T14:47:37.000Z | 2020-11-02T00:00:24.000Z | src/platform/Tickable.cc | lukaspj/Torque6 | db6cd08f18f4917e0c6557b2766fb40d8e2bee39 | [
"MIT"
] | 73 | 2015-02-17T15:07:30.000Z | 2021-10-02T03:11:59.000Z | //-----------------------------------------------------------------------------
// Copyright (c) 2013 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "platform/Tickable.h"
// The statics
U32 Tickable::smLastTick = 0;
U32 Tickable::smLastTime = 0;
U32 Tickable::smLastDelta = 0;
const U32 Tickable::smTickShift = 4;
const U32 Tickable::smTickMs = ( 1 << smTickShift );
const F32 Tickable::smTickSec = ( F32( Tickable::smTickMs ) / 1000.f );
const U32 Tickable::smTickMask = ( smTickMs - 1 );
//------------------------------------------------------------------------------
Tickable::Tickable() :
mProcessTick( false )
{
// We should always start with processing of ticks off!
}
//------------------------------------------------------------------------------
Tickable::~Tickable()
{
setProcessTicks( false );
}
//------------------------------------------------------------------------------
Vector<Tickable *>& Tickable::getProcessList()
{
// This helps to avoid the static initialization order fiasco
static Vector<Tickable *> smProcessList; ///< List of tick controls
return smProcessList;
}
//------------------------------------------------------------------------------
void Tickable::setProcessTicks( bool tick /* = true */ )
{
// Ignore no change.
if ( tick == mProcessTick )
return;
// Update tick flag.
mProcessTick = tick;
// Are we processing ticks?
if ( mProcessTick )
{
// Yes, so add to process list.
getProcessList().push_back( this );
return;
}
// No, so remove from process list.
for( ProcessListIterator i = getProcessList().begin(); i != getProcessList().end(); i++ )
{
if( (*i) == this )
{
getProcessList().erase( i );
return;
}
}
}
//------------------------------------------------------------------------------
bool Tickable::advanceTime( U32 timeDelta )
{
U32 targetTime = smLastTime + timeDelta;
U32 targetTick = ( targetTime + smTickMask ) & ~smTickMask;
U32 tickCount = ( targetTick - smLastTick ) >> smTickShift;
static Vector<Tickable*> safeProcessList;
// Process ticks.
if( tickCount )
{
// Fetch a copy of the process list.
safeProcessList = getProcessList();
for( ; smLastTick != targetTick; smLastTick += smTickMs )
{
for( ProcessListIterator i = safeProcessList.begin(); i != safeProcessList.end(); i++ )
{
(*i)->processTick();
}
}
}
smLastDelta = ( smTickMs - ( targetTime & smTickMask ) ) & smTickMask;
F32 dt = smLastDelta / F32( smTickMs );
// Fetch a copy of the process list.
safeProcessList = getProcessList();
// Interpolate tick.
for( ProcessListIterator i = safeProcessList.begin(); i != safeProcessList.end(); i++ )
{
(*i)->interpolateTick( dt );
}
// Fetch a copy of the process list.
safeProcessList = getProcessList();
dt = F32( timeDelta ) / 1000.f;
for( ProcessListIterator i = safeProcessList.begin(); i != safeProcessList.end(); i++ )
{
(*i)->advanceTime( dt );
}
smLastTime = targetTime;
return tickCount != 0;
}
| 31.625899 | 99 | 0.564377 | [
"vector"
] |
c488a6fea4901ccaa52c60e20e3e86dbc99a96b9 | 7,238 | cpp | C++ | samples/snippets/cpp/VS_Snippets_Remoting/MimeText_Match_MatchColl_9/CPP/mimetext_match_matchcoll_9.cpp | BaruaSourav/docs | c288ed777de6b091f5e074d3488f7934683f3eb5 | [
"CC-BY-4.0",
"MIT"
] | 3,294 | 2016-10-30T05:27:20.000Z | 2022-03-31T15:59:30.000Z | samples/snippets/cpp/VS_Snippets_Remoting/MimeText_Match_MatchColl_9/CPP/mimetext_match_matchcoll_9.cpp | BaruaSourav/docs | c288ed777de6b091f5e074d3488f7934683f3eb5 | [
"CC-BY-4.0",
"MIT"
] | 16,739 | 2016-10-28T19:41:29.000Z | 2022-03-31T22:38:48.000Z | samples/snippets/cpp/VS_Snippets_Remoting/MimeText_Match_MatchColl_9/CPP/mimetext_match_matchcoll_9.cpp | BaruaSourav/docs | c288ed777de6b091f5e074d3488f7934683f3eb5 | [
"CC-BY-4.0",
"MIT"
] | 6,701 | 2016-10-29T20:56:11.000Z | 2022-03-31T12:32:26.000Z | // System.Web.Services.Description.MimeTextMatchCollection
// System.Web.Services.Description.MimeTextMatchCollection()
// System.Web.Services.Description.MimeTextMatchCollection.Contains
// System.Web.Services.Description.MimeTextMatchCollection.Add
// System.Web.Services.Description.MimeTextMatchCollection.CopyTo
// System.Web.Services.Description.MimeTextMatchCollection.Remove
// System.Web.Services.Description.MimeTextMatchCollection.Item
// System.Web.Services.Description.MimeTextMatchCollection.IndexOf
// System.Web.Services.Description.MimeTextMatchCollection.Insert
/* This program demostrates constructor, Contains, Add, Item,
IndexOf, Insert and Remove property of 'MimeTextMatchCollection'.
This program takes 'MimeText_Match_MatchColl_9_Input_CPP.wsdl' as an
input file which does not contain 'Binding' object that supports
'HttpPost'. A name, type, Group and Capture properties are set
which are to be searched in a HTTP transmission and
'MimeTextMatchCollection' collection object is created
for input and output of 'HttpPost' and finally writes into
'MimeText_Match_MatchColl_9_Output_CPP.wsdl'.
*/
#using <System.Xml.dll>
#using <System.Web.Services.dll>
#using <System.dll>
using namespace System;
using namespace System::Web::Services::Description;
using namespace System::Collections;
using namespace System::Xml;
int main()
{
try
{
int myInt = 0;
ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MimeText_Match_MatchColl_9_Input_CPP.wsdl" );
// Create the 'Binding' object.
Binding^ myBinding = gcnew Binding;
// Initialize 'Name' property of 'Binding' class.
myBinding->Name = "MimeText_Match_MatchCollServiceHttpPost";
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MimeText_Match_MatchCollServiceHttpPost" );
myBinding->Type = myXmlQualifiedName;
// Create the 'HttpBinding' object.
HttpBinding^ myHttpBinding = gcnew HttpBinding;
myHttpBinding->Verb = "POST";
// Add the 'HttpBinding' to the 'Binding'.
myBinding->Extensions->Add( myHttpBinding );
// Create the 'OperationBinding' object.
OperationBinding^ myOperationBinding = gcnew OperationBinding;
myOperationBinding->Name = "AddNumbers";
HttpOperationBinding^ myHttpOperationBinding = gcnew HttpOperationBinding;
myHttpOperationBinding->Location = "/AddNumbers";
// Add the 'HttpOperationBinding' to 'OperationBinding'.
myOperationBinding->Extensions->Add( myHttpOperationBinding );
// <Snippet1>
// Create the 'InputBinding' object.
InputBinding^ myInputBinding = gcnew InputBinding;
MimeTextBinding^ myMimeTextBinding = gcnew MimeTextBinding;
MimeTextMatchCollection^ myMimeTextMatchCollection;
// <Snippet5>
// <Snippet4>
// <Snippet3>
// Get an array instance of 'MimeTextMatch' class.
array<MimeTextMatch^>^myMimeTextMatch = gcnew array<MimeTextMatch^>(4);
myMimeTextMatchCollection = myMimeTextBinding->Matches;
// Initialize properties of 'MimeTextMatch' class.
for ( myInt = 0; myInt < 4; myInt++ )
{
// Create the 'MimeTextMatch' instance.
myMimeTextMatch[ myInt ] = gcnew MimeTextMatch;
myMimeTextMatch[ myInt ]->Name = "Title";
myMimeTextMatch[ myInt ]->Type = "*/*";
myMimeTextMatch[ myInt ]->IgnoreCase = true;
if ( true == myMimeTextMatchCollection->Contains( myMimeTextMatch[ 0 ] ) )
{
myMimeTextMatch[ myInt ]->Name = String::Format( "Title{0}", Convert::ToString( myInt ) );
myMimeTextMatch[ myInt ]->Capture = 2;
myMimeTextMatch[ myInt ]->Group = 2;
myMimeTextMatchCollection->Add( myMimeTextMatch[ myInt ] );
}
else
{
myMimeTextMatchCollection->Add( myMimeTextMatch[ myInt ] );
myMimeTextMatchCollection[ myInt ]->RepeatsString = "2";
}
}
myMimeTextMatchCollection = myMimeTextBinding->Matches;
// Copy collection to 'MimeTextMatch' array instance.
myMimeTextMatchCollection->CopyTo( myMimeTextMatch, 0 );
// </Snippet3>
// </Snippet4>
// </Snippet5>
myInputBinding->Extensions->Add( myMimeTextBinding );
// Add the 'InputBinding' to 'OperationBinding'.
myOperationBinding->Input = myInputBinding;
// Create the 'OutputBinding' instance.
OutputBinding^ myOutputBinding = gcnew OutputBinding;
// Create the 'MimeTextBinding' instance.
MimeTextBinding^ myMimeTextBinding1 = gcnew MimeTextBinding;
// <Snippet9>
// <Snippet8>
// <Snippet7>
// <Snippet6>
// <Snippet2>
// Get an instance of 'MimeTextMatchCollection'.
MimeTextMatchCollection^ myMimeTextMatchCollection1 = gcnew MimeTextMatchCollection;
array<MimeTextMatch^>^myMimeTextMatch1 = gcnew array<MimeTextMatch^>(5);
myMimeTextMatchCollection1 = myMimeTextBinding1->Matches;
for ( myInt = 0; myInt < 4; myInt++ )
{
myMimeTextMatch1[ myInt ] = gcnew MimeTextMatch;
myMimeTextMatch1[ myInt ]->Name = String::Format( "Title{0}", Convert::ToString( myInt ) );
if ( myInt != 0 )
{
myMimeTextMatch1[ myInt ]->RepeatsString = "7";
}
myMimeTextMatchCollection1->Add( myMimeTextMatch1[ myInt ] );
}
myMimeTextMatch1[ 4 ] = gcnew MimeTextMatch;
// Remove 'MimeTextMatch' instance from collection.
myMimeTextMatchCollection1->Remove( myMimeTextMatch1[ 1 ] );
// Using MimeTextMatchCollection.Item indexer to comapre.
if ( myMimeTextMatch1[ 2 ] == myMimeTextMatchCollection1[ 1 ] )
{
// Check whether 'MimeTextMatch' instance exists.
myInt = myMimeTextMatchCollection1->IndexOf( myMimeTextMatch1[ 2 ] );
// Insert 'MimeTextMatch' instance at a desired position.
myMimeTextMatchCollection1->Insert( 1, myMimeTextMatch1[ myInt ] );
myMimeTextMatchCollection1[ 1 ]->RepeatsString = "5";
myMimeTextMatchCollection1->Insert( 4, myMimeTextMatch1[ myInt ] );
}
// </Snippet2>
// </Snippet6>
// </Snippet7>
// </Snippet8>
// </Snippet9>
// </Snippet1>
myOutputBinding->Extensions->Add( myMimeTextBinding1 );
// Add the 'OutPutBinding' to 'OperationBinding'.
myOperationBinding->Output = myOutputBinding;
// Add the 'OutPutBinding' to 'OperationBinding'.
myOperationBinding->Output = myOutputBinding;
// Add the 'OperationBinding' to 'Binding'.
myBinding->Operations->Add( myOperationBinding );
// Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'.
myServiceDescription->Bindings->Add( myBinding );
// Write the 'ServiceDescription' as a WSDL file.
myServiceDescription->Write( "MimeText_Match_MatchColl_9_Output_CPP.wsdl" );
Console::WriteLine( "WSDL file with name 'MimeText_Match_MatchColl_9_Output_CPP.wsdl' is"
" created successfully." );
}
catch ( Exception^ e )
{
Console::WriteLine( "Exception: {0}", e->Message );
}
}
| 39.98895 | 121 | 0.680713 | [
"object"
] |
c494d292891d0a15ba9423c112c8bab0f5558f44 | 11,108 | cc | C++ | source/neuropod/bindings/java/src/main/native/com_uber_neuropod_Neuropod.cc | qiyanz/neuropod | 13c2bc794b168583588b68269026ec4ed76163ed | [
"Apache-2.0"
] | 887 | 2020-06-08T16:10:28.000Z | 2022-03-27T21:55:43.000Z | source/neuropod/bindings/java/src/main/native/com_uber_neuropod_Neuropod.cc | qiyanz/neuropod | 13c2bc794b168583588b68269026ec4ed76163ed | [
"Apache-2.0"
] | 150 | 2020-06-09T10:43:15.000Z | 2022-03-30T02:48:39.000Z | source/neuropod/bindings/java/src/main/native/com_uber_neuropod_Neuropod.cc | qiyanz/neuropod | 13c2bc794b168583588b68269026ec4ed76163ed | [
"Apache-2.0"
] | 70 | 2020-06-08T18:43:12.000Z | 2022-03-18T20:37:51.000Z | /* Copyright (c) 2020 UATC, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "com_uber_neuropod_Neuropod.h"
#include "com_uber_neuropod_LibraryLoader.h"
#include "jclass_register.h"
#include "neuropod/core/generic_tensor.hh"
#include "neuropod/neuropod.hh"
#include "utils.h"
#include <exception>
#include <memory>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include <jni.h>
namespace njni = neuropod::jni;
namespace
{
jobject toJavaTensorSpecList(JNIEnv *env, const std::vector<neuropod::TensorSpec> &specs)
{
jobject ret = env->NewObject(njni::java_util_ArrayList, njni::java_util_ArrayList_, specs.size());
if (!ret || env->ExceptionCheck())
{
throw std::runtime_error("NewObject failed: cannot create ArrayList");
}
for (const auto &tensorSpec : specs)
{
auto type = njni::get_tensor_type_field(env, njni::tensor_type_to_string(tensorSpec.type));
jstring name = env->NewStringUTF(tensorSpec.name.c_str());
jobject dims = env->NewObject(njni::java_util_ArrayList, njni::java_util_ArrayList_, tensorSpec.dims.size());
for (const auto &dim : tensorSpec.dims)
{
// Neuropod uses "reserved" number for symbolic Dim.
if (dim.value == -2)
{
jstring symbol = env->NewStringUTF(dim.symbol.c_str());
jobject javaDim = env->NewObject(
njni::com_uber_neuropod_Dimension, njni::com_uber_neuropod_Dimension_symbol_, symbol);
env->CallBooleanMethod(dims, njni::java_util_ArrayList_add, javaDim);
env->DeleteLocalRef(javaDim);
env->DeleteLocalRef(symbol);
}
else
{
jobject javaDim = env->NewObject(
njni::com_uber_neuropod_Dimension, njni::com_uber_neuropod_Dimension_value_, dim.value);
env->CallBooleanMethod(dims, njni::java_util_ArrayList_add, javaDim);
env->DeleteLocalRef(javaDim);
}
}
jobject javaTensorSpec =
env->NewObject(njni::com_uber_neuropod_TensorSpec, njni::com_uber_neuropod_TensorSpec_, name, type, dims);
env->CallBooleanMethod(ret, njni::java_util_ArrayList_add, javaTensorSpec);
env->DeleteLocalRef(name);
env->DeleteLocalRef(dims);
env->DeleteLocalRef(type);
}
return ret;
}
} // namespace
// NOLINTNEXTLINE(readability-identifier-naming): Ignore function case for Java API methods
JNIEXPORT jlong JNICALL Java_com_uber_neuropod_Neuropod_nativeNew__Ljava_lang_String_2J(JNIEnv *env,
jclass /* unused */,
jstring path,
jlong optHandle)
{
try
{
if (optHandle == 0 || env->ExceptionCheck())
{
throw std::runtime_error("illegal state: invalid handle");
}
neuropod::RuntimeOptions opts = *reinterpret_cast<neuropod::RuntimeOptions *>(optHandle);
auto convertedPath = njni::to_string(env, path);
neuropod::Neuropod * ret = new neuropod::Neuropod(convertedPath, opts);
return reinterpret_cast<jlong>(ret);
}
catch (const std::exception &e)
{
njni::throw_java_exception(env, e.what());
}
return reinterpret_cast<jlong>(nullptr);
}
// NOLINTNEXTLINE(readability-identifier-naming): Ignore function case for Java API methods
JNIEXPORT void JNICALL Java_com_uber_neuropod_Neuropod_nativeDelete(JNIEnv *env, jobject obj, jlong handle)
{
try
{
delete reinterpret_cast<neuropod::Neuropod *>(handle);
}
catch (const std::exception &e)
{
njni::throw_java_exception(env, e.what());
}
}
// NOLINTNEXTLINE(readability-identifier-naming): Ignore function case for Java API methods
JNIEXPORT void JNICALL Java_com_uber_neuropod_Neuropod_nativeLoadModel(JNIEnv *env, jclass, jlong handle)
{
try
{
auto model = reinterpret_cast<neuropod::Neuropod *>(handle);
model->load_model();
}
catch (const std::exception &e)
{
njni::throw_java_exception(env, e.what());
}
}
// NOLINTNEXTLINE(readability-identifier-naming): Ignore function case for Java API methods
JNIEXPORT jstring JNICALL Java_com_uber_neuropod_Neuropod_nativeGetName(JNIEnv *env, jclass, jlong handle)
{
try
{
auto model = reinterpret_cast<neuropod::Neuropod *>(handle);
return env->NewStringUTF(model->get_name().c_str());
}
catch (const std::exception &e)
{
njni::throw_java_exception(env, e.what());
}
return nullptr;
}
// NOLINTNEXTLINE(readability-identifier-naming): Ignore function case for Java API methods
JNIEXPORT jstring JNICALL Java_com_uber_neuropod_Neuropod_nativeGetPlatform(JNIEnv *env, jclass, jlong handle)
{
try
{
auto model = reinterpret_cast<neuropod::Neuropod *>(handle);
return env->NewStringUTF(model->get_platform().c_str());
}
catch (const std::exception &e)
{
njni::throw_java_exception(env, e.what());
}
return nullptr;
}
// NOLINTNEXTLINE(readability-identifier-naming): Ignore function case for Java API methods
JNIEXPORT jobject JNICALL Java_com_uber_neuropod_Neuropod_nativeGetInputs(JNIEnv *env, jclass, jlong handle)
{
try
{
auto model = reinterpret_cast<neuropod::Neuropod *>(handle);
auto inputSpec = model->get_inputs();
return toJavaTensorSpecList(env, inputSpec);
}
catch (const std::exception &e)
{
njni::throw_java_exception(env, e.what());
}
return nullptr;
}
// NOLINTNEXTLINE(readability-identifier-naming): Ignore function case for Java API methods
JNIEXPORT jobject JNICALL Java_com_uber_neuropod_Neuropod_nativeGetOutputs(JNIEnv *env, jclass, jlong handle)
{
try
{
auto model = reinterpret_cast<neuropod::Neuropod *>(handle);
auto outputs = model->get_outputs();
return toJavaTensorSpecList(env, outputs);
}
catch (const std::exception &e)
{
njni::throw_java_exception(env, e.what());
}
return nullptr;
}
// NOLINTNEXTLINE(readability-identifier-naming): Ignore function case for Java API methods
JNIEXPORT jlong JNICALL Java_com_uber_neuropod_Neuropod_nativeGetAllocator(JNIEnv *env, jclass, jlong handle)
{
try
{
auto model = reinterpret_cast<neuropod::Neuropod *>(handle);
return reinterpret_cast<jlong>(njni::toHeap(model->get_tensor_allocator()));
}
catch (const std::exception &e)
{
njni::throw_java_exception(env, e.what());
}
return reinterpret_cast<jlong>(nullptr);
}
// NOLINTNEXTLINE(readability-identifier-naming): Ignore function case for Java API methods
JNIEXPORT jlong JNICALL Java_com_uber_neuropod_Neuropod_nativeGetGenericAllocator(JNIEnv *env, jclass)
{
try
{
std::shared_ptr<neuropod::NeuropodTensorAllocator> allocator = neuropod::get_generic_tensor_allocator();
return reinterpret_cast<jlong>(njni::toHeap(allocator));
}
catch (const std::exception &e)
{
njni::throw_java_exception(env, e.what());
}
return reinterpret_cast<jlong>(nullptr);
}
// NOLINTNEXTLINE(readability-identifier-naming): Ignore function case for Java API methods
JNIEXPORT jobject JNICALL Java_com_uber_neuropod_Neuropod_nativeInfer(
JNIEnv *env, jclass, jobjectArray entryArray, jobject requestedOutputsJava, jlong modelHandle)
{
try
{
// Prepare requestedOutputs
std::vector<std::string> requestedOutputs;
if (requestedOutputsJava != nullptr)
{
jsize size = env->CallIntMethod(requestedOutputsJava, njni::java_util_ArrayList_size);
for (jsize i = 0; i < size; i++)
{
jstring element =
static_cast<jstring>(env->CallObjectMethod(requestedOutputsJava, njni::java_util_ArrayList_get, i));
requestedOutputs.emplace_back(njni::to_string(env, element));
env->DeleteLocalRef(element);
}
}
// Fill in NeuropodValueMap
jsize entrySize = env->GetArrayLength(entryArray);
neuropod::NeuropodValueMap nativeMap;
for (jsize i = 0; i < entrySize; i++)
{
jobject entry = env->GetObjectArrayElement(entryArray, i);
std::string key = njni::to_string(
env, static_cast<jstring>(env->CallObjectMethod(entry, njni::java_util_Map_Entry_getKey)));
jobject value = env->CallObjectMethod(entry, njni::java_util_Map_Entry_getValue);
jlong tensorHandle = env->CallLongMethod(value, njni::com_uber_neuropod_NeuropodTensor_getHandle);
if (tensorHandle == 0 || env->ExceptionCheck())
{
throw std::runtime_error("invalid tensor handle");
}
nativeMap.insert(
std::make_pair(key, *reinterpret_cast<std::shared_ptr<neuropod::NeuropodValue> *>(tensorHandle)));
env->DeleteLocalRef(entry);
env->DeleteLocalRef(value);
}
auto model = reinterpret_cast<neuropod::Neuropod *>(modelHandle);
auto inferredMap = model->infer(nativeMap, requestedOutputs);
// Put data to Java Map
auto ret = env->NewObject(njni::java_util_HashMap, njni::java_util_HashMap_);
if (!ret || env->ExceptionCheck())
{
throw std::runtime_error("NewObject failed: cannot create HashMap");
}
for (auto &entry : *inferredMap)
{
jobject javaTensor = env->NewObject(njni::com_uber_neuropod_NeuropodTensor,
njni::com_uber_neuropod_NeuropodTensor_,
reinterpret_cast<jlong>(njni::toHeap(entry.second)));
if (!javaTensor || env->ExceptionCheck())
{
throw std::runtime_error("NewObject failed: cannot create Tensor");
}
env->CallObjectMethod(ret, njni::java_util_HashMap_put, env->NewStringUTF(entry.first.c_str()), javaTensor);
env->DeleteLocalRef(javaTensor);
}
return ret;
}
catch (const std::exception &e)
{
njni::throw_java_exception(env, e.what());
}
return nullptr;
}
| 37.026667 | 120 | 0.64269 | [
"vector",
"model"
] |
c4953ef8234f96bd2f41334a75c412c720f9135c | 6,207 | cpp | C++ | viewOverride/viewOverrideOperations.cpp | artineering-io/viewOverride | d37784e5cc3d2eb25f13ba566e6b6b62e5cd47bb | [
"MIT"
] | null | null | null | viewOverride/viewOverrideOperations.cpp | artineering-io/viewOverride | d37784e5cc3d2eb25f13ba566e6b6b62e5cd47bb | [
"MIT"
] | null | null | null | viewOverride/viewOverrideOperations.cpp | artineering-io/viewOverride | d37784e5cc3d2eb25f13ba566e6b6b62e5cd47bb | [
"MIT"
] | null | null | null | // Title viewOverrideOperations.cpp
// Summary viewOverride Viewport 2.0 render override operations
// Copyright 2020 Artineering and/or its licensors
// License MIT
#include <maya/MShaderManager.h>
#include "viewOverrideOperations.h"
/////////////////////////////////////////////////////////////////////
/// Definition of render operations used in ViewOverride
///
/// 1. Scene render that can render to up to 3 targets
/// 2. Quad render with custom quad shaders
/// 3. Heads Up Display (HUD) operation
/// 4. Present operation
///
/// Of special interest to troubleshoot the transparency object
/// sorting when rendering to multiple render targets is line 51.
/// Change from listSize 3 to 2 and vice-versa to reproduce the bug
///
/////////////////////////////////////////////////////////////////////
// SCENE RENDER
SceneRender::SceneRender(const MString& name,
MHWRender::MSceneRender::MSceneFilterOption sceneFilter, unsigned int clearMask)
: MSceneRender(name)
, mSceneRenderFilter(sceneFilter){
// set up the clear operation (mClearOperation)
float clearColor[4] = { 0.0, 0.0 , 0.0, 0.0 }; // black clear color
mClearOperation.setClearColor(clearColor); // set clear color
mClearOperation.setMask(clearMask); // set mask
}
SceneRender::~SceneRender() {}
void SceneRender::setTargetOverride(unsigned int i, MHWRender::MRenderTarget *target) {
if (i < 3) {
if (target) {
mTargets[i] = target;
}
}
}
MHWRender::MRenderTarget * const * SceneRender::targetOverrideList(unsigned int & listSize) {
if (mTargets) {
if (mSceneRenderFilter == MHWRender::MSceneRender::kRenderUIItems) {
listSize = 2;
return &mTargets[0];
} else {
listSize = 3;
return &mTargets[0];
}
}
listSize = 0;
return nullptr;
}
MHWRender::MClearOperation& SceneRender::clearOperation() {
return mClearOperation; // value set during construction
}
MHWRender::MSceneRender::MSceneFilterOption SceneRender::renderFilterOverride() {
return mSceneRenderFilter; // value set during construction
}
// QUAD RENDER
QuadRender::QuadRender(const MString & name, const MString &shaderFileName, const MString &techniqueName) :
MQuadRender(name),
mShaderFileName(shaderFileName),
mTechniqueName(techniqueName) {
mClearOperation.setClearGradient(false);
mClearOperation.setMask(MHWRender::MClearOperation::kClearNone);
}
QuadRender::~QuadRender() {
clearShaderInstance();
}
const MHWRender::MShaderInstance * QuadRender::shader() {
if (!mShaderInstance) {
const MHWRender::MShaderManager* shaderMgr = MHWRender::MRenderer::theRenderer()->getShaderManager();
mShaderInstance = shaderMgr->getEffectsFileShader(mShaderFileName, mTechniqueName, 0, 0, true);
if (!mShaderInstance) {
cerr << mShaderFileName << " could not be initialized" << endl;
}
}
return mShaderInstance;
}
void QuadRender::clearShaderInstance() {
mShaderInstance = nullptr;
const MHWRender::MShaderManager* shaderMgr = MHWRender::MRenderer::theRenderer()->getShaderManager();
shaderMgr->removeEffectFromCache(mShaderFileName, mTechniqueName, 0, 0);
}
void QuadRender::setTargetOverride(unsigned int i, MHWRender::MRenderTarget *target) {
if (i < 2) {
if (target) {
mTargets[i] = target;
}
}
}
MHWRender::MRenderTarget * const * QuadRender::targetOverrideList(unsigned int & listSize) {
if (mTargets) {
listSize = 2;
return &mTargets[0];
}
listSize = 0;
return nullptr;
}
// HUD RENDER
HUDOperation::HUDOperation(const MString & rendererName) : mRendererName(rendererName) {
mPreviousFrame = std::chrono::high_resolution_clock::now();
mFrameAverage = 0;
mFrameAccu = 0;
mTimeAccu = 0LL;
strcpy(mHUDStatsBuffer, "");
}
HUDOperation::~HUDOperation() {}
bool HUDOperation::hasUIDrawables() const { return true; }
void HUDOperation::addUIDrawables(MHWRender::MUIDrawManager& drawManager2D, const MHWRender::MFrameContext& frameContext) {
// get viewport information
int x = 0, y = 0, w = 0, h = 0;
frameContext.getViewportDimensions(x, y, w, h);
// setup draw
drawManager2D.beginDrawable();
drawManager2D.setColor(MColor(0.3f, 0.3f, 0.3f));
drawManager2D.setFontSize(MHWRender::MUIDrawManager::kSmallFontSize);
// draw renderer name
drawManager2D.text(MPoint(w*0.01f, h*0.97f), mRendererName, MHWRender::MUIDrawManager::kLeft);
// draw viewport size and FPS information
mCurrentFrame = std::chrono::high_resolution_clock::now();
frameDuration = (unsigned int)std::chrono::duration_cast<std::chrono::microseconds>(mCurrentFrame - mPreviousFrame).count();
mTimeAccu += frameDuration;
mFrameAccu++;
if (mTimeAccu > 1000000) {
mFrameAverage = mFrameAccu;
mDurationAverage = mTimeAccu / mFrameAccu;
sprintf(mHUDStatsBuffer, "Resolution [%d, %d] FPS: %d -> each frame: %d us", w, h, mFrameAverage, mDurationAverage);
// reset values
mFrameAccu = 0; mTimeAccu = 0;
}
drawManager2D.text(MPoint(w*0.01f, h*0.95f), mHUDStatsBuffer, MHWRender::MUIDrawManager::kLeft);
mPreviousFrame = mCurrentFrame;
// end draw UI
drawManager2D.endDrawable();
}
void HUDOperation::setTargetOverride(unsigned int i, MHWRender::MRenderTarget *target) {
if (i < 2) {
if (target) {
mTargets[i] = target;
}
}
}
MHWRender::MRenderTarget* const* HUDOperation::targetOverrideList(unsigned int &listSize) {
if (mTargets) {
listSize = 2;
return &mTargets[0];
}
listSize = 0;
return nullptr;
}
/// PRESENT TARGET
MHWRender::MRenderTarget* const* PresentTarget::targetOverrideList(unsigned int &listSize) {
if (mTargets) {
listSize = 2;
return mTargets;
}
listSize = 0;
return nullptr;
}
void PresentTarget::setTargetOverride(unsigned int i, MHWRender::MRenderTarget *target) {
if (i < 2) {
if (target) {
mTargets[i] = target;
}
}
}
| 31.994845 | 129 | 0.657483 | [
"render",
"object"
] |
7bcb316abc4a25f9ab5e285fab59a06fcf97a98f | 13,706 | cpp | C++ | resources/Wireshark/WiresharkDissectorFoo/ui/qt/moc_lbm_lbtrm_transport_dialog.cpp | joshis1/C_Programming | 4a8003321251448a167bfca0b595c5eeab88608d | [
"MIT"
] | 2 | 2020-09-11T05:51:42.000Z | 2020-12-31T11:42:02.000Z | resources/Wireshark/WiresharkDissectorFoo/ui/qt/moc_lbm_lbtrm_transport_dialog.cpp | joshis1/C_Programming | 4a8003321251448a167bfca0b595c5eeab88608d | [
"MIT"
] | null | null | null | resources/Wireshark/WiresharkDissectorFoo/ui/qt/moc_lbm_lbtrm_transport_dialog.cpp | joshis1/C_Programming | 4a8003321251448a167bfca0b595c5eeab88608d | [
"MIT"
] | null | null | null | /****************************************************************************
** Meta object code from reading C++ file 'lbm_lbtrm_transport_dialog.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.6.1)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "lbm_lbtrm_transport_dialog.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'lbm_lbtrm_transport_dialog.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.6.1. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
struct qt_meta_stringdata_LBMLBTRMTransportDialog_t {
QByteArrayData data[42];
char stringdata0[1055];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_LBMLBTRMTransportDialog_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_LBMLBTRMTransportDialog_t qt_meta_stringdata_LBMLBTRMTransportDialog = {
{
QT_MOC_LITERAL(0, 0, 23), // "LBMLBTRMTransportDialog"
QT_MOC_LITERAL(1, 24, 10), // "goToPacket"
QT_MOC_LITERAL(2, 35, 0), // ""
QT_MOC_LITERAL(3, 36, 9), // "PacketNum"
QT_MOC_LITERAL(4, 46, 14), // "setCaptureFile"
QT_MOC_LITERAL(5, 61, 13), // "capture_file*"
QT_MOC_LITERAL(6, 75, 5), // "cfile"
QT_MOC_LITERAL(7, 81, 11), // "closeDialog"
QT_MOC_LITERAL(8, 93, 28), // "on_applyFilterButton_clicked"
QT_MOC_LITERAL(9, 122, 27), // "sourcesDetailCurrentChanged"
QT_MOC_LITERAL(10, 150, 5), // "Index"
QT_MOC_LITERAL(11, 156, 18), // "sourcesItemClicked"
QT_MOC_LITERAL(12, 175, 16), // "QTreeWidgetItem*"
QT_MOC_LITERAL(13, 192, 4), // "item"
QT_MOC_LITERAL(14, 197, 6), // "column"
QT_MOC_LITERAL(15, 204, 20), // "receiversItemClicked"
QT_MOC_LITERAL(16, 225, 30), // "sourcesDetailItemDoubleClicked"
QT_MOC_LITERAL(17, 256, 32), // "receiversDetailItemDoubleClicked"
QT_MOC_LITERAL(18, 289, 32), // "actionSourceDataFrames_triggered"
QT_MOC_LITERAL(19, 322, 7), // "checked"
QT_MOC_LITERAL(20, 330, 31), // "actionSourceDataBytes_triggered"
QT_MOC_LITERAL(21, 362, 37), // "actionSourceDataFramesBytes_t..."
QT_MOC_LITERAL(22, 400, 30), // "actionSourceDataRate_triggered"
QT_MOC_LITERAL(23, 431, 34), // "actionSourceRXDataFrames_trig..."
QT_MOC_LITERAL(24, 466, 33), // "actionSourceRXDataBytes_trigg..."
QT_MOC_LITERAL(25, 500, 39), // "actionSourceRXDataFramesBytes..."
QT_MOC_LITERAL(26, 540, 32), // "actionSourceRXDataRate_triggered"
QT_MOC_LITERAL(27, 573, 31), // "actionSourceNCFFrames_triggered"
QT_MOC_LITERAL(28, 605, 30), // "actionSourceNCFCount_triggered"
QT_MOC_LITERAL(29, 636, 30), // "actionSourceNCFBytes_triggered"
QT_MOC_LITERAL(30, 667, 36), // "actionSourceNCFFramesBytes_tr..."
QT_MOC_LITERAL(31, 704, 35), // "actionSourceNCFCountBytes_tri..."
QT_MOC_LITERAL(32, 740, 36), // "actionSourceNCFFramesCount_tr..."
QT_MOC_LITERAL(33, 777, 41), // "actionSourceNCFFramesCountByt..."
QT_MOC_LITERAL(34, 819, 29), // "actionSourceNCFRate_triggered"
QT_MOC_LITERAL(35, 849, 30), // "actionSourceSMFrames_triggered"
QT_MOC_LITERAL(36, 880, 29), // "actionSourceSMBytes_triggered"
QT_MOC_LITERAL(37, 910, 35), // "actionSourceSMFramesBytes_tri..."
QT_MOC_LITERAL(38, 946, 28), // "actionSourceSMRate_triggered"
QT_MOC_LITERAL(39, 975, 39), // "actionSourceAutoResizeColumns..."
QT_MOC_LITERAL(40, 1015, 35), // "custom_source_context_menuReq..."
QT_MOC_LITERAL(41, 1051, 3) // "pos"
},
"LBMLBTRMTransportDialog\0goToPacket\0\0"
"PacketNum\0setCaptureFile\0capture_file*\0"
"cfile\0closeDialog\0on_applyFilterButton_clicked\0"
"sourcesDetailCurrentChanged\0Index\0"
"sourcesItemClicked\0QTreeWidgetItem*\0"
"item\0column\0receiversItemClicked\0"
"sourcesDetailItemDoubleClicked\0"
"receiversDetailItemDoubleClicked\0"
"actionSourceDataFrames_triggered\0"
"checked\0actionSourceDataBytes_triggered\0"
"actionSourceDataFramesBytes_triggered\0"
"actionSourceDataRate_triggered\0"
"actionSourceRXDataFrames_triggered\0"
"actionSourceRXDataBytes_triggered\0"
"actionSourceRXDataFramesBytes_triggered\0"
"actionSourceRXDataRate_triggered\0"
"actionSourceNCFFrames_triggered\0"
"actionSourceNCFCount_triggered\0"
"actionSourceNCFBytes_triggered\0"
"actionSourceNCFFramesBytes_triggered\0"
"actionSourceNCFCountBytes_triggered\0"
"actionSourceNCFFramesCount_triggered\0"
"actionSourceNCFFramesCountBytes_triggered\0"
"actionSourceNCFRate_triggered\0"
"actionSourceSMFrames_triggered\0"
"actionSourceSMBytes_triggered\0"
"actionSourceSMFramesBytes_triggered\0"
"actionSourceSMRate_triggered\0"
"actionSourceAutoResizeColumns_triggered\0"
"custom_source_context_menuRequested\0"
"pos"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_LBMLBTRMTransportDialog[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
31, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
1, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 169, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
4, 1, 172, 2, 0x0a /* Public */,
7, 0, 175, 2, 0x08 /* Private */,
8, 0, 176, 2, 0x08 /* Private */,
9, 1, 177, 2, 0x08 /* Private */,
11, 2, 180, 2, 0x08 /* Private */,
15, 2, 185, 2, 0x08 /* Private */,
16, 2, 190, 2, 0x08 /* Private */,
17, 2, 195, 2, 0x08 /* Private */,
18, 1, 200, 2, 0x08 /* Private */,
20, 1, 203, 2, 0x08 /* Private */,
21, 1, 206, 2, 0x08 /* Private */,
22, 1, 209, 2, 0x08 /* Private */,
23, 1, 212, 2, 0x08 /* Private */,
24, 1, 215, 2, 0x08 /* Private */,
25, 1, 218, 2, 0x08 /* Private */,
26, 1, 221, 2, 0x08 /* Private */,
27, 1, 224, 2, 0x08 /* Private */,
28, 1, 227, 2, 0x08 /* Private */,
29, 1, 230, 2, 0x08 /* Private */,
30, 1, 233, 2, 0x08 /* Private */,
31, 1, 236, 2, 0x08 /* Private */,
32, 1, 239, 2, 0x08 /* Private */,
33, 1, 242, 2, 0x08 /* Private */,
34, 1, 245, 2, 0x08 /* Private */,
35, 1, 248, 2, 0x08 /* Private */,
36, 1, 251, 2, 0x08 /* Private */,
37, 1, 254, 2, 0x08 /* Private */,
38, 1, 257, 2, 0x08 /* Private */,
39, 0, 260, 2, 0x08 /* Private */,
40, 1, 261, 2, 0x08 /* Private */,
// signals: parameters
QMetaType::Void, QMetaType::Int, 3,
// slots: parameters
QMetaType::Void, 0x80000000 | 5, 6,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void, QMetaType::Int, 10,
QMetaType::Void, 0x80000000 | 12, QMetaType::Int, 13, 14,
QMetaType::Void, 0x80000000 | 12, QMetaType::Int, 13, 14,
QMetaType::Void, 0x80000000 | 12, QMetaType::Int, 13, 14,
QMetaType::Void, 0x80000000 | 12, QMetaType::Int, 13, 14,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void, QMetaType::Bool, 19,
QMetaType::Void,
QMetaType::Void, QMetaType::QPoint, 41,
0 // eod
};
void LBMLBTRMTransportDialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
LBMLBTRMTransportDialog *_t = static_cast<LBMLBTRMTransportDialog *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->goToPacket((*reinterpret_cast< int(*)>(_a[1]))); break;
case 1: _t->setCaptureFile((*reinterpret_cast< capture_file*(*)>(_a[1]))); break;
case 2: _t->closeDialog(); break;
case 3: _t->on_applyFilterButton_clicked(); break;
case 4: _t->sourcesDetailCurrentChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
case 5: _t->sourcesItemClicked((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
case 6: _t->receiversItemClicked((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
case 7: _t->sourcesDetailItemDoubleClicked((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
case 8: _t->receiversDetailItemDoubleClicked((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
case 9: _t->actionSourceDataFrames_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 10: _t->actionSourceDataBytes_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 11: _t->actionSourceDataFramesBytes_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 12: _t->actionSourceDataRate_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 13: _t->actionSourceRXDataFrames_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 14: _t->actionSourceRXDataBytes_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 15: _t->actionSourceRXDataFramesBytes_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 16: _t->actionSourceRXDataRate_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 17: _t->actionSourceNCFFrames_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 18: _t->actionSourceNCFCount_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 19: _t->actionSourceNCFBytes_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 20: _t->actionSourceNCFFramesBytes_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 21: _t->actionSourceNCFCountBytes_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 22: _t->actionSourceNCFFramesCount_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 23: _t->actionSourceNCFFramesCountBytes_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 24: _t->actionSourceNCFRate_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 25: _t->actionSourceSMFrames_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 26: _t->actionSourceSMBytes_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 27: _t->actionSourceSMFramesBytes_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 28: _t->actionSourceSMRate_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 29: _t->actionSourceAutoResizeColumns_triggered(); break;
case 30: _t->custom_source_context_menuRequested((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
void **func = reinterpret_cast<void **>(_a[1]);
{
typedef void (LBMLBTRMTransportDialog::*_t)(int );
if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&LBMLBTRMTransportDialog::goToPacket)) {
*result = 0;
return;
}
}
}
}
const QMetaObject LBMLBTRMTransportDialog::staticMetaObject = {
{ &QDialog::staticMetaObject, qt_meta_stringdata_LBMLBTRMTransportDialog.data,
qt_meta_data_LBMLBTRMTransportDialog, qt_static_metacall, Q_NULLPTR, Q_NULLPTR}
};
const QMetaObject *LBMLBTRMTransportDialog::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *LBMLBTRMTransportDialog::qt_metacast(const char *_clname)
{
if (!_clname) return Q_NULLPTR;
if (!strcmp(_clname, qt_meta_stringdata_LBMLBTRMTransportDialog.stringdata0))
return static_cast<void*>(const_cast< LBMLBTRMTransportDialog*>(this));
return QDialog::qt_metacast(_clname);
}
int LBMLBTRMTransportDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QDialog::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 31)
qt_static_metacall(this, _c, _id, _a);
_id -= 31;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 31)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 31;
}
return _id;
}
// SIGNAL 0
void LBMLBTRMTransportDialog::goToPacket(int _t1)
{
void *_a[] = { Q_NULLPTR, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
QT_END_MOC_NAMESPACE
| 47.099656 | 146 | 0.651321 | [
"object"
] |
7bd467bb32477cf4a89c5c366c94c5030dda2e1a | 5,036 | cpp | C++ | 2019/day6/day6.cpp | Fadi88/AoC | 8b24f2f2cc7b4e1c63758e81e63d8670a261cc7c | [
"Unlicense"
] | 12 | 2019-12-15T21:53:19.000Z | 2021-12-24T17:03:41.000Z | 2019/day6/day6.cpp | Fadi88/adventofcode19 | dd2456bdd163beb02dbfe9dcea2b021061c7671e | [
"Unlicense"
] | 1 | 2021-12-15T20:40:51.000Z | 2021-12-15T22:19:48.000Z | 2019/day6/day6.cpp | Fadi88/adventofcode19 | dd2456bdd163beb02dbfe9dcea2b021061c7671e | [
"Unlicense"
] | 5 | 2020-12-11T06:00:24.000Z | 2021-12-20T21:37:46.000Z | #include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
#include <chrono>
#include <map>
#include <algorithm>
#include <limits>
class timer {
public:
timer(std::string point) {
m_start_point = std::chrono::high_resolution_clock::now();
m_point = point;
}
~timer() {
auto endclock = std::chrono::high_resolution_clock::now();
auto start = std::chrono::time_point_cast<std::chrono::microseconds>(m_start_point).time_since_epoch().count();
auto end = std::chrono::time_point_cast<std::chrono::microseconds>(endclock).time_since_epoch().count();
auto duration = end - start;
double ms = duration * 0.001;
std::cout << "time used by : " << m_point << " was : " << ms << " ms" << std::endl;
}
private:
std::string m_point;
std::chrono::time_point<std::chrono::high_resolution_clock> m_start_point;
};
class system_t {
struct node {
node* ptr_center{nullptr};
std::string name;
bool is_visited{};
uint32_t distance{};
};
private:
std::map<std::string, node*> m_nodes_map;
private:
void _visit_graph(){
for(auto& element : m_nodes_map){
if(!element.second->is_visited){
element.second->distance = 1 + _get_parent_distance(element.second->ptr_center);
element.second->is_visited = true;
}
}
}
uint32_t _get_parent_distance(node * ptr){
if(!ptr)
throw std::runtime_error("nullptr!");
if(ptr->is_visited)
return ptr->distance;
else{
ptr->is_visited = true;
ptr->distance = 1 + _get_parent_distance(ptr->ptr_center);
return ptr->distance;
}
}
std::vector<std::string> _get_origin_path(std::string pt){
std::vector<std::string> ret{};
while(m_nodes_map[pt]->name != "COM" ){
ret.push_back(m_nodes_map[pt]->name);
pt = m_nodes_map[pt]->ptr_center->name;
}
return ret;
}
public:
void add_orbit(std::string p_center, std::string p_orbiter) {
auto orbiter_node_itr = m_nodes_map.find(p_orbiter);
node* orbiter_ptr{nullptr};
if (orbiter_node_itr == m_nodes_map.end()) {
orbiter_ptr = new node();
m_nodes_map[p_orbiter] = orbiter_ptr;
orbiter_ptr->name = p_orbiter;
}
orbiter_ptr = m_nodes_map[p_orbiter];
auto center_node_itr = m_nodes_map.find(p_center);
if (center_node_itr == m_nodes_map.end()) {
node* center_ptr = new node();
m_nodes_map[p_center] = center_ptr;
center_ptr->name = p_center;
if(p_center == "COM")
center_ptr->is_visited = true;
}
orbiter_ptr->ptr_center = m_nodes_map[p_center];
}
uint32_t get_orbit_count(){
uint32_t ret{};
_visit_graph();
for (auto& ele : m_nodes_map) {
ret += ele.second->distance;
}
return ret;
}
uint32_t get_distance_between_points(std::string p_p1 ,std::string p_p2){
auto path_p1 = _get_origin_path(p_p1);
auto path_p2 = _get_origin_path(p_p2);
_visit_graph();
uint32_t ret_distance{std::numeric_limits<uint32_t>::max()};
for(auto p1 :path_p1 ){
for(auto p2 :path_p2 ){
if(p1 == p2)
{
auto tmp_distance =m_nodes_map[p_p1]->distance + m_nodes_map[p_p2]->distance - 2 * m_nodes_map[p1]->distance - 2;
if(tmp_distance < ret_distance)
ret_distance = tmp_distance;
}
}
}
return ret_distance;
}
~system_t() {
for (auto& ele : m_nodes_map) {
delete(ele.second);
}
}
};
void task_1(std::map<std::string, std::string> p_orbits) {
system_t system_obj;
for (auto& ele : p_orbits) {
system_obj.add_orbit(ele.second , ele.first);
}
std::cout << "number of orbits :" << system_obj.get_orbit_count() <<std::endl;
}
void task_2(std::map<std::string, std::string> p_orbits , std::string p_src, std::string p_dst){
system_t system_obj;
for (auto& ele : p_orbits) {
system_obj.add_orbit(ele.second , ele.first);
}
std::cout << "task 2 distance : " << system_obj.get_distance_between_points(p_src , p_dst)<<std::endl;
}
int main() {
std::ifstream input_fd{ "input\\day6_input.txt" };
std::map<std::string,std::string> orbits;
std::string tmp;
{
timer t1("parsing");
while (input_fd >> tmp) {
std::size_t pos = tmp.find(')');
orbits[tmp.substr(pos+1)] = tmp.substr(0,pos);
}
}
{
timer t1("task 1");
task_1(orbits);
}
{
timer t1("task 2");
task_2(orbits , "YOU" , "SAN");
}
return 0;
}
| 24.446602 | 134 | 0.559174 | [
"vector"
] |
7bdd122de4bc69ce7d4d5281ec96833952556882 | 49,097 | cpp | C++ | base/cluster/mgmt/cluscfg/server/cenumcluscfgmanagedresources.cpp | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/cluster/mgmt/cluscfg/server/cenumcluscfgmanagedresources.cpp | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/cluster/mgmt/cluscfg/server/cenumcluscfgmanagedresources.cpp | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | //////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000-2002 Microsoft Corporation
//
// Module Name:
// CEnumClusCfgManagedResources.cpp
//
// Description:
// This file contains the definition of the CEnumClusCfgManagedResources
// class.
//
// The class CEnumClusCfgManagedResources is the enumeration of cluster
// managed devices. It implements the IEnumClusCfgManagedResources
// interface.
//
// Maintained By:
// Galen Barbee (GalenB) 23-FEB-2000
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Include Files
//////////////////////////////////////////////////////////////////////////////
#include "Pch.h"
#include "CEnumClusCfgManagedResources.h"
#include "CEnumUnknownQuorum.h"
//////////////////////////////////////////////////////////////////////////////
// Constant Definitions
//////////////////////////////////////////////////////////////////////////////
DEFINE_THISCLASS( "CEnumClusCfgManagedResources" );
//*************************************************************************//
/////////////////////////////////////////////////////////////////////////////
// CEnumClusCfgManagedResources class
/////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::S_HrCreateInstance
//
// Description:
// Create a CEnumClusCfgManagedResources instance.
//
// Arguments:
// None.
//
// Return Values:
// Pointer to CEnumClusCfgManagedResources instance.
//
//--
//////////////////////////////////////////////////////////////////////////////
HRESULT
CEnumClusCfgManagedResources::S_HrCreateInstance( IUnknown ** ppunkOut )
{
TraceFunc( "" );
HRESULT hr = S_OK;
CEnumClusCfgManagedResources * peccmr = NULL;
if ( ppunkOut == NULL )
{
hr = THR( E_POINTER );
goto Cleanup;
} // if:
peccmr = new CEnumClusCfgManagedResources();
if ( peccmr == NULL )
{
hr = THR( E_OUTOFMEMORY );
goto Cleanup;
} // if: error allocating object
hr = THR( peccmr->HrInit() );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if: HrInit() failed
hr = THR( peccmr->TypeSafeQI( IUnknown, ppunkOut ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if: QI failed
Cleanup:
if ( FAILED( hr ) )
{
LogMsg( L"[SRV] CEnumClusCfgManagedResources::S_HrCreateInstance() failed. (hr = %#08x)", hr );
} // if:
if ( peccmr != NULL )
{
peccmr->Release();
} // if:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::S_HrCreateInstance
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::CEnumClusCfgManagedResources
//
// Description:
// Constructor of the CEnumClusCfgManagedResources class. This initializes
// the m_cRef variable to 1 instead of 0 to account of possible
// QueryInterface failure in DllGetClassObject.
//
// Arguments:
// None.
//
// Return Value:
// None.
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
CEnumClusCfgManagedResources::CEnumClusCfgManagedResources( void )
: m_cRef( 1 )
, m_lcid( LOCALE_NEUTRAL )
{
TraceFunc( "" );
Assert( m_idxNextEnum == 0 );
Assert( m_idxCurrentEnum == 0 );
Assert( m_picccCallback == NULL );
Assert( m_pIWbemServices == NULL );
Assert( m_prgEnums == NULL );
Assert( m_cTotalResources == 0);
Assert( !m_fLoadedDevices );
Assert( m_bstrNodeName == NULL );
// Increment the count of components in memory so the DLL hosting this
// object cannot be unloaded.
InterlockedIncrement( &g_cObjects );
TraceFuncExit();
} //*** CEnumClusCfgManagedResources::CEnumClusCfgManagedResources
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::~CEnumClusCfgManagedResources
//
// Description:
// Desstructor of the CEnumClusCfgManagedResources class.
//
// Arguments:
// None.
//
// Return Value:
// None.
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
CEnumClusCfgManagedResources::~CEnumClusCfgManagedResources( void )
{
TraceFunc( "" );
ULONG idx;
if ( m_pIWbemServices != NULL )
{
m_pIWbemServices->Release();
} // if:
if ( m_picccCallback != NULL )
{
m_picccCallback->Release();
} // if:
for ( idx = 0; idx < m_idxNextEnum; idx++ )
{
Assert( (m_prgEnums[ idx ]).punk != NULL );
(m_prgEnums[ idx ]).punk->Release();
TraceSysFreeString( (m_prgEnums[ idx ]).bstrComponentName );
} // for: each enum in the array...
TraceFree( m_prgEnums );
TraceSysFreeString( m_bstrNodeName );
// There's going to be one less component in memory. Decrement component count.
InterlockedDecrement( &g_cObjects );
TraceFuncExit();
} //*** CEnumClusCfgManagedResources::~CEnumClusCfgManagedResources
//*************************************************************************//
/////////////////////////////////////////////////////////////////////////////
// CEnumClusCfgManagedResources -- IUknkown interface.
/////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::AddRef
//
// Description:
// Increment the reference count of this object by one.
//
// Arguments:
// None.
//
// Return Value:
// The new reference count.
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP_( ULONG )
CEnumClusCfgManagedResources::AddRef( void )
{
TraceFunc( "[IUnknown]" );
InterlockedIncrement( &m_cRef );
CRETURN( m_cRef );
} //*** CEnumClusCfgManagedResources::AddRef
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::Release
//
// Description:
// Decrement the reference count of this object by one.
//
// Arguments:
// None.
//
// Return Value:
// The new reference count.
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP_( ULONG )
CEnumClusCfgManagedResources::Release( void )
{
TraceFunc( "[IUnknown]" );
LONG cRef;
cRef = InterlockedDecrement( &m_cRef );
if ( cRef == 0 )
{
TraceDo( delete this );
} // if: reference count equal to zero
CRETURN( cRef );
} //*** CEnumClusCfgManagedResources::Release
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::QueryInterface
//
// Description:
// Query this object for the passed in interface.
//
// Arguments:
// riidIn
// Id of interface requested.
//
// ppvOut
// Pointer to the requested interface.
//
// Return Value:
// S_OK
// If the interface is available on this object.
//
// E_NOINTERFACE
// If the interface is not available.
//
// E_POINTER
// ppvOut was NULL.
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP
CEnumClusCfgManagedResources::QueryInterface(
REFIID riidIn
, void ** ppvOut
)
{
TraceQIFunc( riidIn, ppvOut );
HRESULT hr = S_OK;
//
// Validate arguments.
//
Assert( ppvOut != NULL );
if ( ppvOut == NULL )
{
hr = THR( E_POINTER );
goto Cleanup;
}
//
// Handle known interfaces.
//
if ( IsEqualIID( riidIn, IID_IUnknown ) )
{
*ppvOut = static_cast< IEnumClusCfgManagedResources * >( this );
} // if: IUnknown
else if ( IsEqualIID( riidIn, IID_IEnumClusCfgManagedResources ) )
{
*ppvOut = TraceInterface( __THISCLASS__, IEnumClusCfgManagedResources, this, 0 );
} // else if: IEnumClusCfgManagedResources
else if ( IsEqualIID( riidIn, IID_IClusCfgWbemServices ) )
{
*ppvOut = TraceInterface( __THISCLASS__, IClusCfgWbemServices, this, 0 );
} // else if: IClusCfgWbemServices
else if ( IsEqualIID( riidIn, IID_IClusCfgInitialize ) )
{
*ppvOut = TraceInterface( __THISCLASS__, IClusCfgInitialize, this, 0 );
} // else if: IClusCfgInitialize
else
{
*ppvOut = NULL;
hr = E_NOINTERFACE;
}
//
// Add a reference to the interface if successful.
//
if ( SUCCEEDED( hr ) )
{
((IUnknown *) *ppvOut)->AddRef();
} // if: success
Cleanup:
QIRETURN_IGNORESTDMARSHALLING( hr, riidIn );
} //*** CEnumClusCfgManagedResources::QueryInterface
//*************************************************************************//
/////////////////////////////////////////////////////////////////////////////
// CEnumClusCfgManagedResources -- IClusCfgWbemServices interface.
/////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::SetWbemServices
//
// Description:
// Set the WBEM services provider.
//
// Arguments:
// IN IWbemServices pIWbemServicesIn
//
// Return Value:
// S_OK
// Success
//
// E_POINTER
// The pIWbemServicesIn param is NULL.
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP
CEnumClusCfgManagedResources::SetWbemServices( IWbemServices * pIWbemServicesIn )
{
TraceFunc( "[IClusCfgWbemServices]" );
HRESULT hr = S_OK;
if ( pIWbemServicesIn == NULL )
{
hr = THR( E_POINTER );
STATUS_REPORT_REF( TASKID_Major_Find_Devices, TASKID_Minor_SetWbemServices_Enum_Resources, IDS_ERROR_NULL_POINTER, IDS_ERROR_NULL_POINTER_REF, hr );
goto Cleanup;
} // if:
m_pIWbemServices = pIWbemServicesIn;
m_pIWbemServices->AddRef();
Cleanup:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::SetWbemServices
//*************************************************************************//
/////////////////////////////////////////////////////////////////////////////
// CEnumClusCfgManagedResources -- IClusCfgInitialize interface.
/////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::Initialize
//
// Description:
// Initialize this component.
//
// Arguments:
// IN IUknown * punkCallbackIn
//
// IN LCID lcidIn
//
// Return Value:
// S_OK
// Success
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP
CEnumClusCfgManagedResources::Initialize(
IUnknown * punkCallbackIn,
LCID lcidIn
)
{
TraceFunc( "[IClusCfgInitialize]" );
Assert( m_picccCallback == NULL );
HRESULT hr = S_OK;
m_lcid = lcidIn;
if ( punkCallbackIn == NULL )
{
hr = THR( E_POINTER );
goto Cleanup;
} // if:
hr = THR( punkCallbackIn->TypeSafeQI( IClusCfgCallback, &m_picccCallback ) );
Cleanup:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::Initialize
//*************************************************************************//
/////////////////////////////////////////////////////////////////////////////
// CEnumClusCfgManagedResources -- IEnumClusCfgManagedResources interface.
/////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::Next
//
// Description:
//
// Arguments:
//
// Return Value:
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP
CEnumClusCfgManagedResources::Next(
ULONG cNumberRequestedIn
, IClusCfgManagedResourceInfo ** rgpManagedResourceInfoOut
, ULONG * pcNumberFetchedOut
)
{
TraceFunc( "[IEnumClusCfgManagedResources]" );
Assert( rgpManagedResourceInfoOut != NULL );
Assert( ( cNumberRequestedIn <= 1 ) || ( pcNumberFetchedOut != NULL ) );
HRESULT hr;
ULONG cFetched = 0;
if ( rgpManagedResourceInfoOut == NULL )
{
hr = THR( E_POINTER );
STATUS_REPORT_REF( TASKID_Major_Find_Devices, TASKID_Minor_Next_Enum_Resources, IDS_ERROR_NULL_POINTER, IDS_ERROR_NULL_POINTER_REF, hr );
goto Cleanup;
} // if:
//
// pcNumberFetchedOut can only be NULL when the number requested is 1.
//
if ( ( pcNumberFetchedOut == NULL )
&& ( cNumberRequestedIn > 1 ) )
{
hr = THR( E_INVALIDARG );
STATUS_REPORT_REF( TASKID_Major_Find_Devices, TASKID_Minor_Next_Enum_Resources, IDS_ERROR_NULL_POINTER, IDS_ERROR_NULL_POINTER_REF, hr );
goto Cleanup;
} // if:
if ( m_fLoadedDevices == FALSE )
{
hr = THR( HrLoadEnum() );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
} // if:
hr = STHR( HrDoNext( cNumberRequestedIn, rgpManagedResourceInfoOut, &cFetched ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
//
// Do they want the out count?
//
if ( pcNumberFetchedOut != NULL )
{
*pcNumberFetchedOut = cFetched;
} // if:
Cleanup:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::Next
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::Skip
//
// Description:
//
// Arguments:
//
// Return Value:
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP
CEnumClusCfgManagedResources::Skip( ULONG cNumberToSkipIn )
{
TraceFunc( "[IEnumClusCfgManagedResources]" );
HRESULT hr = S_FALSE;
if ( cNumberToSkipIn > 0 )
{
hr = STHR( HrDoSkip( cNumberToSkipIn ) );
} // if:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::Skip
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::Reset
//
// Description:
//
// Arguments:
//
// Return Value:
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP
CEnumClusCfgManagedResources::Reset( void )
{
TraceFunc( "[IEnumClusCfgManagedResources]" );
HRESULT hr;
hr = STHR( HrDoReset() );
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::Reset
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::Clone
//
// Description:
//
// Arguments:
//
// Return Value:
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP
CEnumClusCfgManagedResources::Clone(
IEnumClusCfgManagedResources ** ppEnumClusCfgManagedResourcesOut
)
{
TraceFunc( "[IEnumClusCfgManagedResources]" );
HRESULT hr = S_OK;
if ( ppEnumClusCfgManagedResourcesOut == NULL )
{
hr = THR( E_POINTER );
STATUS_REPORT_REF( TASKID_Major_Find_Devices, TASKID_Minor_Clone_Enum_Resources, IDS_ERROR_NULL_POINTER, IDS_ERROR_NULL_POINTER_REF, hr );
goto Cleanup;
} // else:
hr = THR( HrDoClone( ppEnumClusCfgManagedResourcesOut ) );
Cleanup:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::Clone
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::Count
//
// Description:
//
// Arguments:
//
// Return Value:
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP
CEnumClusCfgManagedResources::Count( DWORD * pnCountOut )
{
TraceFunc( "[IEnumClusCfgManagedResources]" );
HRESULT hr = S_OK;
if ( pnCountOut == NULL )
{
hr = THR( E_POINTER );
goto Cleanup;
} // if:
if ( !m_fLoadedDevices )
{
hr = THR( HrLoadEnum() );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
} // if:
*pnCountOut = m_cTotalResources;
Cleanup:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::Count
//*************************************************************************//
/////////////////////////////////////////////////////////////////////////////
// CEnumClusCfgManagedResources class -- Private Methods.
/////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::HrInit
//
// Description:
// Initialize this component.
//
// Arguments:
// None.
//
// Return Value:
// S_OK - Success.
// Other HRESULTs.
//
//--
//////////////////////////////////////////////////////////////////////////////
HRESULT
CEnumClusCfgManagedResources::HrInit( void )
{
TraceFunc( "" );
HRESULT hr = S_OK;
// IUnknown
Assert( m_cRef == 1 );
hr = THR( HrGetComputerName(
ComputerNameDnsHostname
, &m_bstrNodeName
, TRUE // fBestEffortIn
) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
Cleanup:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::HrInit
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::HrLoadEnum
//
// Description:
// Load this enumerator.
//
// Arguments:
// None.
//
// Return Value:
//
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
HRESULT
CEnumClusCfgManagedResources::HrLoadEnum( void )
{
TraceFunc( "" );
Assert( m_prgEnums == NULL );
HRESULT hr = S_OK;
IUnknown * punk = NULL;
ICatInformation * pici = NULL;
CATID rgCatIds[ 1 ];
IEnumCLSID * pieclsids = NULL;
IEnumClusCfgManagedResources * pieccmr = NULL;
CLSID clsid;
ULONG cFetched;
WCHAR szGUID[ 64 ];
int cch;
BSTR bstrComponentName = NULL;
rgCatIds[ 0 ] = CATID_EnumClusCfgManagedResources;
hr = THR( CoCreateInstance( CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER, IID_ICatInformation, (void **) &pici ) );
if ( FAILED( hr ) )
{
goto Cleanup;
}
hr = THR( pici->EnumClassesOfCategories( 1, rgCatIds, 0, NULL, &pieclsids ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
for ( ; ; )
{
//
// Cleanup.
//
if ( punk != NULL )
{
punk->Release();
punk = NULL;
} // if:
TraceSysFreeString( bstrComponentName );
bstrComponentName = NULL;
hr = STHR( pieclsids->Next( 1, &clsid, &cFetched ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
//
// When hr is S_FALSE and the count is 0 then the enum is really
// at the end.
//
if ( ( hr == S_FALSE ) && ( cFetched == 0 ) )
{
hr = S_OK;
break;
} // if:
//
// Create a GUID string for logging purposes...
//
cch = StringFromGUID2( clsid, szGUID, RTL_NUMBER_OF( szGUID ) );
Assert( cch > 0 ); // 64 chars should always hold a guid!
//
// Get the best name we have available for the COM component. If for
// any reason we cannot get the name then make one up and continue.
//
hr = THR( HrGetDefaultComponentNameFromRegistry( &clsid, &bstrComponentName ) );
if ( FAILED( hr ) )
{
bstrComponentName = TraceSysAllocString( L"<Unknown> component" );
if ( bstrComponentName == NULL )
{
hr = THR( E_OUTOFMEMORY );
goto Cleanup;
} // if:
} // if:
//
// If we cannot create the component then log the error and continue. We should load as many components as we can.
//
hr = THR( HrCoCreateInternalInstance( clsid, NULL, CLSCTX_SERVER, IID_IEnumClusCfgManagedResources, (void **) &pieccmr ) );
if ( FAILED( hr ) )
{
LOG_STATUS_REPORT_STRING_MINOR2( TASKID_Minor_MREnum_Cannot_Create_Component, L"Could not create component %1!ws! %2!ws!.", bstrComponentName, szGUID, hr );
hr = S_OK;
continue;
} // if:
//
// If we cannot QI the component then log the error and continue. We should load as many components as we can.
//
hr = THR( pieccmr->TypeSafeQI( IUnknown, &punk ) );
if ( FAILED( hr ) )
{
LOG_STATUS_REPORT_STRING_MINOR2( TASKID_Minor_MREnum_Cannot_QI_Component_For_Punk, L"Could not QI for IUnknown on component %1!ws! %2!ws!.", bstrComponentName, szGUID, hr );
hr = S_OK;
continue;
} // if:
punk = TraceInterface( L"IEnumClusCfgManagedResources", IUnknown, punk, 1 );
pieccmr->Release();
pieccmr = NULL;
//
// If this fails then simply skip it and move on...
//
hr = HrInitializeAndSaveEnum( punk, &clsid, bstrComponentName );
if ( FAILED( hr ) )
{
LOG_STATUS_REPORT_STRING_MINOR2( TASKID_Minor_MREnum_Cannot_Save_Provider, L"Could not save enumerator component %1!ws! %2!ws!.", bstrComponentName, szGUID, hr );
hr = S_OK;
continue;
} // if:
if ( hr == S_OK )
{
m_fLoadedDevices = TRUE; // there is at least one provider loaded.
} // if:
} // for: each CLSID that implements our CATID...
hr = STHR( HrLoadUnknownQuorumProvider() );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
Cleanup:
if ( pieclsids != NULL )
{
pieclsids->Release();
} // if:
if ( pici != NULL )
{
pici->Release();
} // if:
if ( pieccmr != NULL )
{
pieccmr->Release();
} // if:
if ( punk != NULL )
{
punk->Release();
} // if:
TraceSysFreeString( bstrComponentName );
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::HrLoadEnum
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::HrDoNext
//
// Description:
// Gets the required number of elements from the contained physical disk
// and optional 3rd party device enumerations.
//
// Arguments:
//
// Return Value:
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
HRESULT
CEnumClusCfgManagedResources::HrDoNext(
ULONG cNumberRequestedIn
, IClusCfgManagedResourceInfo ** rgpManagedResourceInfoOut
, ULONG * pcNumberFetchedOut
)
{
TraceFunc( "" );
Assert( rgpManagedResourceInfoOut != NULL );
Assert( pcNumberFetchedOut != NULL );
Assert( m_prgEnums != NULL );
HRESULT hr = S_FALSE;
IEnumClusCfgManagedResources * peccsd = NULL;
ULONG cRequested = cNumberRequestedIn;
ULONG cFetched = 0;
ULONG cTotal = 0;
IClusCfgManagedResourceInfo ** ppccmriTemp = rgpManagedResourceInfoOut;
int cch;
WCHAR szGUID[ 64 ];
//
// Call each enumerator in the list trying to get the number of requested
// items. Note that we may call the same enumerator more than once in
// this loop. The second call is to ensure that we are really at the
// end of the enumerator.
//
LOG_STATUS_REPORT_STRING3( L"[SRV] Enumerating resources. Total Requested:%1!d!; Current enum index:%2!d!; Total Enums:%3!d!.", cNumberRequestedIn, m_idxCurrentEnum, m_idxNextEnum, hr );
while ( m_idxCurrentEnum < m_idxNextEnum )
{
//
// Cleanup.
//
if ( peccsd != NULL )
{
peccsd->Release();
peccsd = NULL;
} // if:
cch = StringFromGUID2( (m_prgEnums[ m_idxCurrentEnum ]).clsid, szGUID, RTL_NUMBER_OF( szGUID ) );
Assert( cch > 0 ); // 64 chars should always hold a guid!
Assert( (m_prgEnums[ m_idxCurrentEnum ]).punk != NULL );
hr = THR( (m_prgEnums[ m_idxCurrentEnum ]).punk->TypeSafeQI( IEnumClusCfgManagedResources, &peccsd ) );
if ( FAILED( hr ) )
{
HRESULT hrTemp;
//
// Convert this into a warning in the UI...
//
hrTemp = MAKE_HRESULT( SEVERITY_SUCCESS, HRESULT_FACILITY( hr ), HRESULT_CODE( hr ) );
//
// If we cannot QI for the enum then move on to the next one.
//
STATUS_REPORT_STRING2_REF(
TASKID_Major_Find_Devices
, TASKID_Minor_Enum_Enum_QI_Failed
, IDS_WARNING_SKIPPING_ENUM
, (m_prgEnums[ m_idxCurrentEnum ]).bstrComponentName
, szGUID
, IDS_WARNING_SKIPPING_ENUM
, hrTemp
);
m_idxCurrentEnum++;
continue;
} // if:
hr = STHR( peccsd->Next( cRequested, ppccmriTemp, &cFetched ) );
if ( FAILED( hr ) )
{
HRESULT hrTemp;
//
// Convert this into a warning in the UI...
//
hrTemp = MAKE_HRESULT( SEVERITY_SUCCESS, HRESULT_FACILITY( hr ), HRESULT_CODE( hr ) );
//
// If this enumerator fails for anyreason then we should skip it
// and move on to the next one.
//
STATUS_REPORT_STRING2_REF(
TASKID_Major_Find_Devices
, TASKID_Minor_Enum_Enum_Next_Failed
, IDS_WARNING_SKIPPING_ENUM
, (m_prgEnums[ m_idxCurrentEnum ]).bstrComponentName
, szGUID
, IDS_WARNING_SKIPPING_ENUM
, hrTemp
);
m_idxCurrentEnum++;
continue;
} // if:
else if ( hr == S_OK )
{
cTotal += cFetched;
//
// We can only return S_OK if the number of elements returned is equal to
// the number of elements requested. If the number request is greater than
// the number returned then we must return S_FALSE.
//
Assert( cNumberRequestedIn == cTotal );
*pcNumberFetchedOut = cTotal;
break;
} // else if: hr == S_OK
else if ( hr == S_FALSE )
{
//
// The only time that we can be certain that an enumerator is
// empty is to get S_FALSE and no elements returned. Now that
// the current enumerator empty move up to the next one in the
// list.
//
if ( cFetched == 0 )
{
m_idxCurrentEnum++;
continue;
} // if:
//
// Update the totals...
//
cTotal += cFetched;
*pcNumberFetchedOut = cTotal;
cRequested -= cFetched;
//
// If we got some items and still got S_FALSE then we have to
// retry the current enumerator.
//
if ( cRequested > 0 )
{
ppccmriTemp += cFetched;
continue;
} // if: Safety check... Ensure that we still need more elements...
else
{
//
// We should not have decremented requested items below zero!
//
hr = S_FALSE;
LOG_STATUS_REPORT_MINOR( TASKID_Minor_MREnum_Negative_Item_Count, L"The managed resources enumerator tried to return more items than asked for.", hr );
goto Cleanup;
} // else: Should not get here...
} // if: hr == S_FALSE
else
{
//
// Should not get here as we are in an unknown state...
//
LOG_STATUS_REPORT_MINOR( TASKID_Minor_MREnum_Unknown_State, L"The managed resources enumerator encountered an unknown state.", hr );
goto Cleanup;
} // else: unexpected hresult...
} // while: more enumerators in the list
//
// If we haven't honored the complete request then we must return
// S_FALSE;
//
if ( *pcNumberFetchedOut < cNumberRequestedIn )
{
hr = S_FALSE;
} // if:
Cleanup:
if ( peccsd != NULL )
{
peccsd->Release();
} // if:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::HrDoNext
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::HrDoSkip
//
// Description:
// Skips the required number of elements in the contained physical disk
// and optional 3rd party device enumerations.
//
// Arguments:
//
// Return Value:
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
HRESULT
CEnumClusCfgManagedResources::HrDoSkip(
ULONG cNumberToSkipIn
)
{
TraceFunc( "" );
Assert( m_prgEnums != NULL );
HRESULT hr = S_FALSE;
IEnumClusCfgManagedResources * peccsd = NULL;
ULONG cSkipped = 0;
for ( ; m_idxCurrentEnum < m_idxNextEnum; )
{
hr = THR( (m_prgEnums[ m_idxCurrentEnum ]).punk->TypeSafeQI( IEnumClusCfgManagedResources, &peccsd ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
do
{
hr = STHR( peccsd->Skip( 1 ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
if ( hr == S_FALSE )
{
m_idxCurrentEnum++;
break;
} // if:
}
while( cNumberToSkipIn >= (++cSkipped) );
peccsd->Release();
peccsd = NULL;
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
if ( cNumberToSkipIn == cSkipped )
{
break;
} // if:
} // for:
Cleanup:
if ( peccsd != NULL )
{
peccsd->Release();
} // if:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::HrDoSkip
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::HrDoReset
//
// Description:
// Resets the elements in the contained physical disk and optional 3rd
// party device enumerations.
//
// Arguments:
//
// Return Value:
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
HRESULT
CEnumClusCfgManagedResources::HrDoReset( void )
{
TraceFunc( "" );
HRESULT hr = S_FALSE;
IEnumClusCfgManagedResources * peccsd;
ULONG idx;
m_idxCurrentEnum = 0;
for ( idx = m_idxCurrentEnum; idx < m_idxNextEnum; idx++ )
{
Assert( m_prgEnums != NULL );
hr = THR( (m_prgEnums[ idx ]).punk->TypeSafeQI( IEnumClusCfgManagedResources, &peccsd ) );
if ( FAILED( hr ) )
{
break;
} // if:
hr = STHR( peccsd->Reset() );
peccsd->Release();
if ( FAILED( hr ) )
{
break;
} // if:
} // for:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::HrDoReset
//////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources::HrDoClone
//
// Description:
// Clones the elements in the contained physical disk and optional 3rd
// party device enumerations.
//
// Arguments:
//
// Return Value:
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
HRESULT
CEnumClusCfgManagedResources::HrDoClone(
IEnumClusCfgManagedResources ** ppEnumClusCfgManagedResourcesOut
)
{
TraceFunc( "" );
HRESULT hr = THR( E_NOTIMPL );
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::HrDoClone
/////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources:HrAddToEnumsArray
//
// Description:
// Add the passed in punk to the array of punks that holds the enums.
//
// Arguments:
//
//
// Return Value:
// S_OK
// Success
//
// E_OUTOFMEMORY
// Couldn't allocate memeory.
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
HRESULT
CEnumClusCfgManagedResources::HrAddToEnumsArray(
IUnknown * punkIn
, CLSID * pclsidIn
, BSTR bstrComponentNameIn
)
{
TraceFunc( "" );
Assert( punkIn != NULL );
Assert( pclsidIn != NULL );
Assert( bstrComponentNameIn != NULL );
HRESULT hr = S_OK;
SEnumInfo * prgEnums = NULL;
IEnumClusCfgManagedResources * pieccmr = NULL;
DWORD nAmountToAdd = 0;
hr = punkIn->TypeSafeQI( IEnumClusCfgManagedResources, &pieccmr );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
hr = pieccmr->Count( &nAmountToAdd );
if ( FAILED( hr ) )
{
WCHAR szGUID[ 64 ];
int cch;
HRESULT hrTemp;
//
// Convert this into a warning in the UI...
//
hrTemp = MAKE_HRESULT( SEVERITY_SUCCESS, HRESULT_FACILITY( hr ), HRESULT_CODE( hr ) );
cch = StringFromGUID2( *pclsidIn, szGUID, RTL_NUMBER_OF( szGUID ) );
Assert( cch > 0 ); // 64 chars should always hold a guid!
STATUS_REPORT_STRING2_REF(
TASKID_Major_Find_Devices
, TASKID_Minor_Enum_Enum_Count_Failed
, IDS_WARNING_SKIPPING_ENUM
, bstrComponentNameIn
, szGUID
, IDS_WARNING_SKIPPING_ENUM
, hrTemp
);
goto Cleanup;
} // if:
prgEnums = (SEnumInfo *) TraceReAlloc( m_prgEnums, sizeof( SEnumInfo ) * ( m_idxNextEnum + 1 ), HEAP_ZERO_MEMORY );
if ( prgEnums == NULL )
{
hr = THR( E_OUTOFMEMORY );
STATUS_REPORT_REF( TASKID_Major_Find_Devices, TASKID_Minor_HrAddToEnumsArray, IDS_ERROR_OUTOFMEMORY, IDS_ERROR_OUTOFMEMORY_REF, hr );
goto Cleanup;
} // if:
m_prgEnums = prgEnums;
//
// Fill in the newly allocated struct.
//
(m_prgEnums[ m_idxNextEnum ]).punk = punkIn;
(m_prgEnums[ m_idxNextEnum ]).punk->AddRef();
CopyMemory( &((m_prgEnums[ m_idxNextEnum ]).clsid), pclsidIn, sizeof( ( m_prgEnums[ m_idxNextEnum ]).clsid ) );
//
// Capture the component name. We don't really care if this fails.
// Simply show the popup for anyone who may be watching and continue on.
//
(m_prgEnums[ m_idxNextEnum ]).bstrComponentName = TraceSysAllocString( bstrComponentNameIn );
if ( (m_prgEnums[ m_idxNextEnum ]).bstrComponentName == NULL )
{
THR( E_OUTOFMEMORY );
} // if:
//
// Increment the enum index pointer.
//
m_idxNextEnum++;
m_cTotalResources += nAmountToAdd;
Cleanup:
if ( pieccmr != NULL )
{
pieccmr->Release();
}
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::HrAddToEnumsArray
/////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources:HrLoadUnknownQuorumProvider
//
// Description:
// Since we cannot resonable expect every 3rd party quorum vender
// to write a "provider" for their device for this setup wizard
// we need a proxy to represent that quorum device. The "unknown"
// is just such a proxy.
//
// Arguments:
// None.
//
// Return Value:
// S_OK
// Success
//
// E_OUTOFMEMORY
// Couldn't allocate memeory.
//
// Remarks:
// If this node is clustered and we do not find a device that is
// already the quorum then we need to make the "unknown" quorum
// the quorum device.
//
//--
//////////////////////////////////////////////////////////////////////////////
HRESULT
CEnumClusCfgManagedResources::HrLoadUnknownQuorumProvider( void )
{
TraceFunc( "" );
HRESULT hr = S_OK;
IUnknown * punk = NULL;
BOOL fNeedQuorum = FALSE;
BOOL fQuormIsOwnedByThisNode = FALSE;
BSTR bstrQuorumResourceName = NULL;
BSTR bstrComponentName = NULL;
hr = STHR( HrIsClusterServiceRunning() );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
if ( hr == S_OK )
{
hr = STHR( HrIsThereAQuorumDevice() );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
if ( hr == S_FALSE )
{
fNeedQuorum = TRUE;
} // if:
hr = THR( HrGetQuorumResourceName( &bstrQuorumResourceName, &fQuormIsOwnedByThisNode ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
} // if:
//
// If there was not already a quorum, and if this node owns the quorum resource
// then we need the unknown quorum proxy to be set as default to the quorum device.
//
// If we are not running on a cluster node then both are false and the unknown
// quorum proxy will not be set by default to be the quorum.
//
hr = THR( CEnumUnknownQuorum::S_HrCreateInstance( bstrQuorumResourceName, ( fNeedQuorum && fQuormIsOwnedByThisNode ), &punk ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
hr = THR( HrLoadStringIntoBSTR( g_hInstance, IDS_ENUM_UNKNOWN_QUORUM_COMPONENT_NAME, &bstrComponentName ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
hr = THR( HrInitializeAndSaveEnum( punk, const_cast< CLSID * >( &CLSID_EnumUnknownQuorum ), bstrComponentName ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
Cleanup:
if ( punk != NULL )
{
punk->Release();
} // if:
TraceSysFreeString( bstrQuorumResourceName );
TraceSysFreeString( bstrComponentName );
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::HrLoadUnknownQuorumProvider
/////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources:HrIsClusterServiceRunning
//
// Description:
// Is this node a member of a cluster and is the serice running?
//
// Arguments:
// None.
//
// Return Value:
// S_OK
// The node is clustered and the serivce is running.
//
// S_FALSE
// The node is not clustered, or the serivce is not running.
//
// Win32 Error
// something failed.
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
HRESULT
CEnumClusCfgManagedResources::HrIsClusterServiceRunning( void )
{
TraceFunc( "" );
HRESULT hr = S_FALSE;
DWORD sc;
DWORD dwClusterState;
//
// Get the cluster state of the node.
// Ignore the case where the service does not exist so that
// EvictCleanup can do its job.
//
sc = GetNodeClusterState( NULL, &dwClusterState );
if ( ( sc != ERROR_SUCCESS ) && ( sc != ERROR_SERVICE_DOES_NOT_EXIST ) )
{
hr = HRESULT_FROM_WIN32( TW32( sc ) );
goto Cleanup;
} // if : GetClusterState() failed
if ( dwClusterState == ClusterStateRunning )
{
hr = S_OK;
} // if:
Cleanup:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::HrIsClusterServiceRunning
/////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources:HrIsThereAQuorumDevice
//
// Description:
// Is there a quorum device in an enum somewhere?
//
// Arguments:
// None.
//
// Return Value:
// S_OK
// There is a quorum device.
//
// S_FALSE
// There is not a quorum device.
//
// Win32 Error
// something failed.
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
HRESULT
CEnumClusCfgManagedResources::HrIsThereAQuorumDevice( void )
{
TraceFunc( "" );
Assert( m_idxCurrentEnum == 0 );
HRESULT hr = S_OK;
IClusCfgManagedResourceInfo * piccmri = NULL;
DWORD cFetched;
bool fFoundQuorum = false;
for ( ; ; )
{
hr = STHR( Next( 1, &piccmri, &cFetched ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
if ( ( hr == S_FALSE ) && ( cFetched == 0 ) )
{
hr = S_OK;
break;
} // if:
hr = STHR( piccmri->IsQuorumResource() );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
if ( hr == S_OK )
{
fFoundQuorum = true;
break;
} // if:
piccmri->Release();
piccmri = NULL;
} // for:
hr = THR( Reset() );
Cleanup:
if ( piccmri != NULL )
{
piccmri->Release();
} // if:
if ( SUCCEEDED( hr ) )
{
if ( fFoundQuorum )
{
hr = S_OK;
} // if:
else
{
hr = S_FALSE;
} // else:
} // if:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::HrIsThereAQuorumDevice
/////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources:HrInitializeAndSaveEnum
//
// Description:
// Initialize the passed in enum and add it to the array of enums.
//
// Arguments:
//
// Return Value:
// S_OK
// Success.
//
// S_FALSE
// The provider was not saved.
//
// Win32 Error
// something failed.
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
HRESULT
CEnumClusCfgManagedResources::HrInitializeAndSaveEnum(
IUnknown * punkIn
, CLSID * pclsidIn
, BSTR bstrComponentNameIn
)
{
TraceFunc( "" );
Assert( punkIn != NULL );
Assert( pclsidIn != NULL );
Assert( bstrComponentNameIn != NULL );
HRESULT hr = S_OK;
//
// KB: 13-JUN-2000 GalenB
//
// If S_FALSE is returned don't add this to the array. S_FALSE
// indicates that this enumerator should not be run now.
//
hr = STHR( HrSetInitialize( punkIn, m_picccCallback, m_lcid ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
if ( hr == S_FALSE )
{
goto Cleanup;
} // if:
hr = HrSetWbemServices( punkIn, m_pIWbemServices );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
hr = THR( HrAddToEnumsArray( punkIn, pclsidIn, bstrComponentNameIn ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
Cleanup:
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::HrInitializeAndSaveEnum
/////////////////////////////////////////////////////////////////////////////
//++
//
// CEnumClusCfgManagedResources:HrGetQuorumResourceName
//
// Description:
// Get the quorum resource name and return whether or not this node
// owns the quorum.
//
// Arguments:
//
// Return Value:
// S_OK
// Success.
//
// Win32 Error
// something failed.
//
// Remarks:
// None.
//
//--
//////////////////////////////////////////////////////////////////////////////
HRESULT
CEnumClusCfgManagedResources::HrGetQuorumResourceName(
BSTR * pbstrQuorumResourceNameOut
, BOOL * pfQuormIsOwnedByThisNodeOut
)
{
TraceFunc( "" );
Assert( pbstrQuorumResourceNameOut != NULL );
Assert( pfQuormIsOwnedByThisNodeOut != NULL );
HRESULT hr = S_OK;
DWORD sc;
HCLUSTER hCluster = NULL;
BSTR bstrQuorumResourceName = NULL;
BSTR bstrNodeName = NULL;
HRESOURCE hQuorumResource = NULL;
BSTR bstrLocalNetBIOSName = NULL;
//
// Get netbios name for clusapi calls.
//
hr = THR( HrGetComputerName( ComputerNameNetBIOS, &bstrLocalNetBIOSName, TRUE ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
hCluster = OpenCluster( NULL );
if ( hCluster == NULL )
{
sc = TW32( GetLastError() );
hr = HRESULT_FROM_WIN32( sc );
goto Cleanup;
} // if:
hr = THR( HrGetClusterQuorumResource( hCluster, &bstrQuorumResourceName, NULL, NULL ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
hQuorumResource = OpenClusterResource( hCluster, bstrQuorumResourceName );
if ( hQuorumResource == NULL )
{
sc = TW32( GetLastError() );
hr = HRESULT_FROM_WIN32( sc );
goto Cleanup;
} // if:
hr = THR( HrGetClusterResourceState( hQuorumResource, &bstrNodeName, NULL, NULL ) );
if ( FAILED( hr ) )
{
goto Cleanup;
} // if:
//
// Give ownership away.
//
Assert( bstrQuorumResourceName != NULL );
*pbstrQuorumResourceNameOut = bstrQuorumResourceName;
bstrQuorumResourceName = NULL;
*pfQuormIsOwnedByThisNodeOut = ( NBSTRCompareNoCase( bstrLocalNetBIOSName, bstrNodeName ) == 0 );
Cleanup:
if ( hQuorumResource != NULL )
{
CloseClusterResource( hQuorumResource );
} // if:
if ( hCluster != NULL )
{
CloseCluster( hCluster );
} // if:
TraceSysFreeString( bstrQuorumResourceName );
TraceSysFreeString( bstrLocalNetBIOSName );
TraceSysFreeString( bstrNodeName );
HRETURN( hr );
} //*** CEnumClusCfgManagedResources::HrGetQuorumResourceName
| 25.598019 | 191 | 0.477137 | [
"object"
] |
7bdeab80048fac1e41ce2a79eaacc989fc611fbb | 16,008 | cpp | C++ | projects/LuaLib/src/SystemAPI.cpp | mikaelkindborg/mobilelua | 64424ab2116330cc3be729f84a2d014b1b7c9c64 | [
"MIT"
] | 27 | 2015-12-16T16:57:13.000Z | 2022-03-27T05:54:32.000Z | projects/LuaLib/src/SystemAPI.cpp | mikaelkindborg/mobilelua | 64424ab2116330cc3be729f84a2d014b1b7c9c64 | [
"MIT"
] | null | null | null | projects/LuaLib/src/SystemAPI.cpp | mikaelkindborg/mobilelua | 64424ab2116330cc3be729f84a2d014b1b7c9c64 | [
"MIT"
] | 4 | 2015-10-25T02:19:06.000Z | 2021-07-06T07:16:13.000Z | /*
* Copyright (c) 2011 MoSync AB
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <ma.h>
#include <maheap.h>
#include <mastring.h>
#include <mawstring.h>
#include <conprint.h>
#include <MAUtil/String.h>
#include <MAUtil/Geometry.h>
#include <MAUI/Font.h>
#include <MAUI/Font.h>
#include <IX_WIDGET.h>
extern "C" {
#include "inc/SystemAPI.h"
}
/**********************************************************
* Helper classes used locally in this file
**********************************************************/
/**
* C++ classes go in the MobileLua namespace.
* C-functions are in the global namespace.
*/
namespace MobileLua
{
class TextObject
{
public:
MAUI::Font* font;
MAUtil::String text;
TextObject()
{
// Created font lazily when needed.
font = NULL;
}
virtual ~TextObject()
{
if (NULL != font)
{
delete font;
font = NULL;
}
}
MAUI::Font* getFont()
{
return font;
}
const char* getString()
{
return text.c_str();
}
};
} // namespace MobileLua
/**********************************************************
* Functions for text and font handling
**********************************************************/
extern "C" void* SysTextCreate(int fontHandle)
{
MobileLua::TextObject* textObj = new MobileLua::TextObject();
textObj->font = new MAUI::Font(fontHandle);
return (void*) textObj;
}
extern "C" void SysTextDelete(void* textObj)
{
MobileLua::TextObject* self = (MobileLua::TextObject*)textObj;
delete self;
}
extern "C" void SysTextSetString(void* textObj, char* str)
{
MobileLua::TextObject* self = (MobileLua::TextObject*)textObj;
self->text = str;
}
extern "C" void SysTextSetLineSpacing(void* textObj, int lineSpacing)
{
MobileLua::TextObject* self = (MobileLua::TextObject*)textObj;
self->font->setLineSpacing(lineSpacing);
}
extern "C" int SysTextGetStringSize(void* textObj, int extent)
{
MobileLua::TextObject* self = (MobileLua::TextObject*)textObj;
if (0 == extent)
{
return self->font->getStringDimensions(
self->getString());
}
else
{
MAUtil::Rect bounds(0, 0, EXTENT_X(extent), EXTENT_Y(extent));
return self->font->getBoundedStringDimensions(
self->getString(),
bounds);
}
}
extern "C" void SysTextDrawString(void* textObj, int x, int y, int extent)
{
MobileLua::TextObject* self = (MobileLua::TextObject*)textObj;
if (0 == extent)
{
return self->font->drawString(
self->getString(),
x,
y);
}
else
{
MAUtil::Rect bounds(0, 0, EXTENT_X(extent), EXTENT_Y(extent));
return self->font->drawBoundedString(
self->getString(),
x,
y,
bounds);
}
}
/**********************************************************
* Functions for using C memory from Lua
**********************************************************/
/**
* Allocate a memory block.
*/
extern "C" void* SysAlloc(int size)
{
return malloc(size);
}
/**
* Use this function to free allocated data structures.
*/
extern "C" void SysFree(void* buffer)
{
free(buffer);
}
/**
* Get an int value in a memory block.
* @param buffer Pointer to memory block.
* @param index Offset to an integer index (as if the
* memory block was an array of ints).
* @return The int at the given index.
*/
extern "C" int SysBufferGetInt(void* buffer, int index)
{
int* p = (int*) buffer;
return p[index];
}
/**
* Set an int value in a memory block.
* @param buffer Pointer to memory block.
* @param index Offset to an integer index (as if the
* memory block was an array of ints).
*/
extern "C" void SysBufferSetInt(void* buffer, int index, int value)
{
int* p = (int*) buffer;
p[index] = value;
}
/**
* Get a byte value in a memory block.
* @param buffer Pointer to memory block.
* @param index Offset to a byte index (as if the
* memory block was an array of bytes).
* @return The byte value at the given index.
*/
extern "C" int SysBufferGetByte(void* buffer, int index)
{
byte* p = (byte*) buffer;
return (int) (p[index]);
}
/**
* Set a byte value in a memory block.
* @param buffer Pointer to memory block.
* @param index Offset to a byte index (as if the
* memory block was an array of bytes).
*/
extern "C" void SysBufferSetByte(void* buffer, int index, int value)
{
byte* p = (byte*) buffer;
p[index] = (byte) value;
}
/**
* Get an float value in a memory block.
* @param buffer Pointer to memory block.
* @param index Offset to a float index (as if the
* memory block was an array of floats).
* @return The float value at the given index.
*/
extern "C" float SysBufferGetFloat(void* buffer, int index)
{
float* p = (float*) buffer;
return p[index];
}
/**
* Get an double value in a memory block.
* @param buffer Pointer to memory block.
* @param index Offset to a double index (as if the
* memory block was an array of doubles).
* @return The double value at the given index.
*/
extern "C" double SysBufferGetDouble(void* buffer, int index)
{
double* p = (double*) buffer;
return p[index];
}
/**
* Copy bytes from one memory block to another. The number of bytes
* given by numberOfBytesToCopy bytes, starting at sourceIndex in
* the source block, will be copied to the destination block,
* starting at destIndex.
* @param sourceBuffer Pointer to the source memory block.
* @param sourceIndex Offset to a byte index in the source block.
* @param destBuffer Pointer to the destination memory block.
* @param destIndex Offset to a byte index in the destination block.
* @param numberOfBytesToCopy Number of bytes that will be copied
* from source to destination.
*/
extern "C" void SysBufferCopyBytes(
void* sourceBuffer,
int sourceIndex,
void* destBuffer,
int destIndex,
int numberOfBytesToCopy)
{
byte* source = (byte*) sourceBuffer;
byte* dest = (byte*) destBuffer;
// Not the very fastest implementation perhaps...
for (int i = 0; i < numberOfBytesToCopy; ++i)
{
dest[destIndex + i] = source[sourceIndex + i];
}
}
/**
* Return a pointer to a byte at an index in a buffer.
* This function is useful when calling functions that
* write to memory using a pointer, or to read data
* from a particular place in a memory block.
* @param buffer Pointer to memory block.
* @param index Offset to a byte index.
* @return A pointer to the byte at the given index.
*/
void* SysBufferGetBytePointer(void* buffer, int index)
{
return ((char*) buffer) + index;
}
/**********************************************************
* Functions for getting the size of C data types
**********************************************************/
/**
* Get the size of an int in bytes.
* @return The size.
*/
extern "C" int SysSizeOfInt()
{
return (int) sizeof(int);
}
/**
* Get the size of an int in bytes.
* @return The size.
*/
extern "C" int SysSizeOfFloat()
{
return (int) sizeof(float);
}
/**
* Get the size of an int in bytes.
* @return The size.
*/
extern "C" int SysSizeOfDouble()
{
return (int) sizeof(double);
}
/**********************************************************
* Functions for bit operations and bit-shift
**********************************************************/
extern "C" int SysBitAnd(int a, int b)
{
return ((unsigned int) a) & ((unsigned int) a);
}
extern "C" int SysBitOr(int a, int b)
{
return ((unsigned int) a) | ((unsigned int) a);
}
extern "C" int SysBitXor(int a, int b)
{
return ((unsigned int) a) ^ ((unsigned int) a);
}
extern "C" int SysBitNot(int a)
{
return ~((unsigned int) a);
}
extern "C" int SysBitShiftLeft(int a, int bits)
{
return ((unsigned int) a) << bits;
}
extern "C" int SysBitShiftRight(int a, int bits)
{
return ((unsigned int) a) >> bits;
}
/**********************************************************
* Event functions
**********************************************************/
extern "C" MAEvent* SysEventCreate()
{
return (MAEvent*) SysAlloc(sizeof(MAEvent));
}
extern "C" int SysEventGetType(MAEvent* event)
{
return event->type;
}
extern "C" int SysEventGetKey(MAEvent* event)
{
return event->key;
}
extern "C" int SysEventGetNativeKey(MAEvent* event)
{
return event->nativeKey;
}
extern "C" uint SysEventGetCharacter(MAEvent* event)
{
return event->character;
}
extern "C" int SysEventGetX(MAEvent* event)
{
return event->point.x;
}
extern "C" int SysEventGetY(MAEvent* event)
{
return event->point.y;
}
extern "C" int SysEventGetTouchId(MAEvent* event)
{
return event->touchId;
}
extern "C" int SysEventGetState(MAEvent* event)
{
return event->state;
}
extern "C" MAHandle SysEventGetConnHandle(MAEvent* event)
{
return event->conn.handle;
}
extern "C" int SysEventGetConnOpType(MAEvent* event)
{
return event->conn.opType;
}
extern "C" int SysEventGetConnResult(MAEvent* event)
{
return event->conn.result;
}
extern "C" int SysEventGetTextBoxResult(MAEvent* event)
{
return event->textboxResult;
}
extern "C" int SysEventGetTextBoxLength(MAEvent* event)
{
return event->textboxLength;
}
extern "C" void* SysEventGetData(MAEvent* event)
{
return event->data;
}
extern "C" int SysEventSensorGetType(MAEvent* event)
{
return event->sensor.type;
}
extern "C" float SysEventSensorGetValue1(MAEvent* event)
{
return event->sensor.values[0];
}
extern "C" float SysEventSensorGetValue2(MAEvent* event)
{
return event->sensor.values[1];
}
extern "C" float SysEventSensorGetValue3(MAEvent* event)
{
return event->sensor.values[2];
}
extern "C" int SysEventLocationGetState(MAEvent* event)
{
return ((MALocation*)(event->data))->state;
}
extern "C" double SysEventLocationGetLat(MAEvent* event)
{
return ((MALocation*)(event->data))->lat;
}
extern "C" double SysEventLocationGetLon(MAEvent* event)
{
return ((MALocation*)(event->data))->lon;
}
extern "C" double SysEventLocationGetHorzAcc(MAEvent* event)
{
return ((MALocation*)(event->data))->horzAcc;
}
extern "C" double SysEventLocationGetVertAcc(MAEvent* event)
{
return ((MALocation*)(event->data))->vertAcc;
}
extern "C" float SysEventLocationGetAlt(MAEvent* event)
{
return ((MALocation*)(event->data))->alt;
}
extern "C" int SysWidgetEventGetType(void* widgetEvent)
{
return ((MAWidgetEventData*)widgetEvent)->eventType;
}
extern "C" int SysWidgetEventGetHandle(void* widgetEvent)
{
return ((MAWidgetEventData*)widgetEvent)->widgetHandle;
}
extern "C" int SysWidgetEventGetListItemIndex(void* widgetEvent)
{
return ((MAWidgetEventData*)widgetEvent)->listItemIndex;
}
extern "C" int SysWidgetEventGetChecked(void* widgetEvent)
{
return ((MAWidgetEventData*)widgetEvent)->checked;
}
extern "C" int SysWidgetEventGetTabIndex(void* widgetEvent)
{
return ((MAWidgetEventData*)widgetEvent)->tabIndex;
}
extern "C" int SysWidgetEventGetUrlData(void* widgetEvent)
{
return ((MAWidgetEventData*)widgetEvent)->urlData;
}
/**********************************************************
* Point functions
**********************************************************/
extern "C" MAPoint2d* SysPointCreate()
{
return (MAPoint2d*) SysAlloc(sizeof(MAPoint2d));
}
extern "C" int SysPointGetX(MAPoint2d* point)
{
return point->x;
}
extern "C" int SysPointGetY(MAPoint2d* point)
{
return point->y;
}
extern "C" void SysPointSetX(MAPoint2d* point, int x)
{
point->x = x;
}
extern "C" void SysPointSetY(MAPoint2d* point, int y)
{
point->y = y;
}
/**********************************************************
* Rect functions
**********************************************************/
extern "C" MARect* SysRectCreate()
{
return (MARect*) SysAlloc(sizeof(MARect));
}
extern "C" int SysRectGetLeft(MARect* rect)
{
return rect->left;
}
extern "C" int SysRectGetTop(MARect* rect)
{
return rect->top;
}
extern "C" int SysRectGetWidth(MARect* rect)
{
return rect->width;
}
extern "C" int SysRectGetHeight(MARect* rect)
{
return rect->height;
}
extern "C" void SysRectSetLeft(MARect* rect, int left)
{
rect->left = left;
}
extern "C" void SysRectSetTop(MARect* rect, int top)
{
rect->top = top;
}
extern "C" void SysRectSetWidth(MARect* rect, int width)
{
rect->width = width;
}
extern "C" void SysRectSetHeight(MARect* rect, int height)
{
rect->height = height;
}
/**********************************************************
* Misc functions and string functions
**********************************************************/
extern "C" MACopyData* SysCopyDataCreate(
MAHandle dst, int dstOffset, MAHandle src, int srcOffset, int size)
{
MACopyData* data = (MACopyData*) SysAlloc(sizeof(MACopyData));
if (NULL != data)
{
data->dst = dst;
data->dstOffset = dstOffset;
data->src = src;
data->srcOffset = srcOffset;
data->size = size;
}
return data;
}
extern "C" void SysScreenSetColor(int red, int green, int blue)
{
int color = (red << 16) | (green << 8) | blue;
maSetColor(color);
}
extern "C" void SysScreenDrawText(const char* text, int x, int y, void* font)
{
MAUI::Font* pFont = (MAUI::Font*) font;
if (NULL == pFont)
{
lprintfln("SysScreenDrawText: Font not found");
return;
}
lprintfln("SysScreenDrawText: Drawing text: %s", text);
// Draw string.
MAUtil::Rect bounds(0, 0, EXTENT_X(maGetScrSize()), EXTENT_Y(maGetScrSize()));
pFont->drawBoundedString(text, x, y, bounds);
}
/**
* Convert a char string to a wchar string.
* It is the responsibility of the caller to deallocate the
* returned string with SysBufferDelete.
*/
extern "C" void* SysStringCharToWideChar(const char* str)
{
if (NULL == str)
{
return NULL;
}
// Allocate result string.
int length = strlen(str);
wchar* wstr = (wchar*) SysAlloc((1 + length) * sizeof(wchar));
if (NULL == wstr)
{
return NULL;
}
// Copy string.
int i;
for (i = 0; i < length; ++i)
{
wstr[i] = str[i];
}
// Zero terminate string.
wstr[i] = 0;
return wstr;
}
/**
* Convert a wchar string to a char string.
* In C it is the responsibility of the caller to deallocate the
* returned string with SysFree. When called from Lua, a Lua string
* will be returned.
* Conversion only supports basic 256 char set.
*/
extern "C" char* SysStringWideCharToChar(const void* wstr)
{
if (NULL == wstr)
{
return NULL;
}
// Allocate result string.
int length = wcslen((wchar*)wstr);
char* str = (char*) SysAlloc((1 + length) * sizeof(char));
if (NULL == str)
{
return NULL;
}
// Copy string.
int i;
for (i = 0; i < length; ++i)
{
// Brute force conversion!
str[i] = (char) ((wchar*)wstr)[i];
}
// Zero terminate string.
str[i] = 0;
return str;
}
/**
* Helper method that reads a text string from resource file.
* In C it is the responsibility of the caller to deallocate the
* returned string with SysFree. When called from Lua, a Lua string
* will be returned.
*/
extern "C" char* SysLoadStringResource(MAHandle data)
{
// Get size of data.
int size = maGetDataSize(data);
// Allocate space for text plus zero termination character.
char* text = (char*) SysAlloc(size + 1);
if (NULL == text)
{
return NULL;
}
// Read data.
maReadData(data, text, 0, size);
// Zero terminate string.
text[size] = 0;
return text;
}
| 21.839018 | 80 | 0.647301 | [
"geometry"
] |
7be1ed0838ef6cc82c737fe6c13c24adbd615e4c | 910 | cpp | C++ | 01-arduino/06-send/04-send-generic/src/main.cpp | acarabott/unity-arduino | 55f2f271eb60d08d701cbcafe972d4a937e55b53 | [
"MIT"
] | 2 | 2018-06-05T00:14:18.000Z | 2020-12-15T14:52:38.000Z | 01-arduino/06-send/04-send-generic/src/main.cpp | acarabott/unity-arduino | 55f2f271eb60d08d701cbcafe972d4a937e55b53 | [
"MIT"
] | null | null | null | 01-arduino/06-send/04-send-generic/src/main.cpp | acarabott/unity-arduino | 55f2f271eb60d08d701cbcafe972d4a937e55b53 | [
"MIT"
] | null | null | null | #include <Arduino.h>
#include <ArduinoJson.h>
const float ANALOG_MAX = 1023.0f;
const int D2 = 2;
const int D4 = 4;
void setup() {
Serial.begin(115200);
while (!Serial) continue;
pinMode(2, INPUT);
pinMode(4, INPUT);
pinMode(7, INPUT);
}
void loop() {
// create our JSON object
ArduinoJson::StaticJsonBuffer<200> jsonBuffer;
ArduinoJson::JsonObject& jsonData = jsonBuffer.createObject();
// add the analog data
jsonData["A0"] = analogRead(A0) / ANALOG_MAX;
jsonData["A1"] = analogRead(A1) / ANALOG_MAX;
jsonData["A2"] = analogRead(A2) / ANALOG_MAX;
jsonData["A3"] = analogRead(A3) / ANALOG_MAX;
jsonData["A4"] = analogRead(A4) / ANALOG_MAX;
jsonData["A5"] = analogRead(A5) / ANALOG_MAX;
// add the digital data
jsonData["D2"] = digitalRead(D2);
jsonData["D4"] = digitalRead(D4);
// send the JSON data via serial
jsonData.printTo(Serial);
Serial.println();
}
| 22.195122 | 64 | 0.673626 | [
"object"
] |
7be5f4e6817bd3b959fb12402abb5dbafb5fa9fd | 4,911 | cpp | C++ | optimal_control_acado/EocarNphases.cpp | Carla-Ferreira/ViolinOptimalControl | 6a0d1e1880b845ce15b6d6b9412b60acb1a6f55f | [
"MIT"
] | 3 | 2019-07-02T13:37:14.000Z | 2022-03-31T17:29:31.000Z | optimal_control_acado/EocarNphases.cpp | Carla-Ferreira/ViolinOptimalControl | 6a0d1e1880b845ce15b6d6b9412b60acb1a6f55f | [
"MIT"
] | 1 | 2020-04-16T02:21:49.000Z | 2020-04-16T02:21:49.000Z | optimal_control_acado/EocarNphases.cpp | Carla-Ferreira/ViolinOptimalControl | 6a0d1e1880b845ce15b6d6b9412b60acb1a6f55f | [
"MIT"
] | 11 | 2019-04-23T15:14:07.000Z | 2021-04-02T15:05:49.000Z | #include <acado_optimal_control.hpp>
#include <bindings/acado_gnuplot/gnuplot_window.hpp>
#include "BiorbdModel.h"
#include "includes/dynamics.h"
#include "includes/objectives.h"
#include "includes/constraints.h"
#include "includes/utils.h"
#include <vector>
#include <memory>
USING_NAMESPACE_ACADO
/* ---------- Model ---------- */
biorbd::Model m("../../models/ModelTest.bioMod");
#include "includes/biorbd_initializer.h"
const double t_Start = 0.0;
const double t_End = 4.0;
const int nPoints(31);
const int nPhases(2);
const std::string resultsPath("../../Results/");
const std::string initializePath("../Initialisation/");
const std::string resultsName("Eocar");
int main ()
{
clock_t start = clock();
std::cout << "nb de muscles: " << nMus << std::endl;
std::cout << "nb de torques: " << nTau << std::endl;
std::cout << "nb de marqueurs: " << nMarkers << std::endl;
initializeMuscleStates();
// ----------- DEFINE OCP ------------- //
OCP ocp(t_Start, t_End, nPoints);
CFunction F( nQ+nQdot, forwardDynamics_noContact);
DifferentialEquation f ;
// ---------- INITIALIZATION ---------- //
std::vector<DifferentialState> x1;
std::vector<Control> mus1;
std::vector<Control> torque1;
std::vector<IntermediateState> is1;
// ------------ CONSTRAINTS ----------- //
for (unsigned int p=0; p<nPhases; ++p){
x1.push_back(DifferentialState("",nQ+nQdot,1));
mus1.push_back(Control("", nMus, 1));
torque1.push_back(Control("", nTau, 1));
is1.push_back(IntermediateState(nQ + nQdot + nMus + nTau));
for (unsigned int i = 0; i < nQ; ++i)
is1[p](i) = x1[p](i);
for (unsigned int i = 0; i < nQdot; ++i)
is1[p](i+nQ) = x1[p](i+nQ);
for (unsigned int i = 0; i < nMus; ++i)
is1[p](i+nQ+nQdot) = mus1[p](i);
for (unsigned int i = 0; i < nTau; ++i)
is1[p](i+nQ+nQdot+nMus) = torque1[p](i);
(f << dot( x1[p] )) == F(is1[p]);
if (p == 0) {
ocp.subjectTo( AT_START, x1[p](0) == 0 );
ocp.subjectTo( AT_END, x1[p](0) == 10 );
ocp.subjectTo( AT_START, x1[p](1) == 0);
ocp.subjectTo( AT_END, x1[p](1) == 0);
}
else {
ocp.subjectTo( 0.0, x1[p], -x1[p-1], 0.0 );
ocp.subjectTo( 0.0, x1[p-1], -x1[p], 0.0 );
}
// ocp.subjectTo( AT_START, x1(2) == 0 );
// ocp.subjectTo( AT_END, x1(2) == 0 );
// ocp.subjectTo( AT_START, x1(3) == 0 );
// ocp.subjectTo( AT_END, x1(3) == 0 );
for (unsigned int i=0; i<nMus; ++i)
ocp.subjectTo(0.01 <= mus1[p](i) <= 1);
for (unsigned int i=0; i<nTau; ++i)
ocp.subjectTo(-100 <= torque1[p](i) <= 100);
}
ocp.subjectTo( f ) ;
// ------------ OBJECTIVE ----------- //
Expression sumLagrange(torque1[0] * torque1[0] + mus1[0]*mus1[0]);
for(unsigned int p=1; p<nPhases; ++p) {
sumLagrange += torque1[p] * torque1[p] + mus1[p]*mus1[p];
}
ocp.minimizeLagrangeTerm(sumLagrange);
// ---------- VISUALIZATION ------------ //
GnuplotWindow window;
for (unsigned int p=0; p<nPhases; ++p){
window.addSubplot( x1[p](0), "Etat 0 " );
window.addSubplot( x1[p](1), "Etat 1 " );
window.addSubplot( mus1[p](0), "CONTROL 1" ) ;
window.addSubplot( torque1[p](0), "CONTROL 2" ) ;
}
/* ---------- OPTIMIZATION ------------ */
OptimizationAlgorithm algorithm( ocp ) ; // construct optimization algorithm ,
algorithm.set(MAX_NUM_ITERATIONS, 500);
algorithm.initializeDifferentialStates((resultsPath + "InitStates" + resultsName + ".txt").c_str(), BT_TRUE);
algorithm.initializeControls((resultsPath + "InitControls" + resultsName + ".txt").c_str());
algorithm << window;
algorithm.solve();
VariablesGrid controls, test;
algorithm.getDifferentialStates(test);
algorithm.getControls(controls);
VariablesGrid n1 = test.getValuesSubGrid(0 , (nQ + nQdot) * (nPhases - 1) + 1);
VariablesGrid n2 = test.getValuesSubGrid(0, (nQ + nQdot) * (nPhases - 1) + 2);
VariablesGrid n3 = controls.getValuesSubGrid(0, nTau * (nPhases - 1));
VariablesGrid n4 = controls.getValuesSubGrid(0, nTau * (nPhases - 1));
n1.appendValues(n2);
n1.print((resultsPath + "InitStates" + resultsName + ".txt").c_str());
n3.appendValues(n4);
n3.print((resultsPath + "InitControls" + resultsName + ".txt").c_str());
createTreePath(resultsPath);
algorithm.getDifferentialStates((resultsPath + "States" + resultsName + ".txt").c_str());
algorithm.getControls((resultsPath + "Controls" + resultsName + ".txt").c_str());
clock_t end=clock();
double time_exec(double(end - start)/CLOCKS_PER_SEC);
std::cout<<"Execution time: "<<time_exec<<std::endl;
return 0;
}
| 34.342657 | 113 | 0.570963 | [
"vector",
"model"
] |
7bf2e83ee9ea0b714aaf1a264abdca7dc3613544 | 13,916 | cpp | C++ | aabb.cpp | BachiLi/delta_ray | 67694873e73f8ffa0b22acd09bf178d31d926d46 | [
"MIT"
] | null | null | null | aabb.cpp | BachiLi/delta_ray | 67694873e73f8ffa0b22acd09bf178d31d926d46 | [
"MIT"
] | null | null | null | aabb.cpp | BachiLi/delta_ray | 67694873e73f8ffa0b22acd09bf178d31d926d46 | [
"MIT"
] | null | null | null | #include "aabb.h"
#include <iostream>
AABB::AABB() {
p_min = make_vector3(std::numeric_limits<float>::infinity(),
std::numeric_limits<float>::infinity(),
std::numeric_limits<float>::infinity() );
p_max = make_vector3(-std::numeric_limits<float>::infinity(),
-std::numeric_limits<float>::infinity(),
-std::numeric_limits<float>::infinity() );
}
AABB::AABB(const Vector3f &v0, const Vector3f &v1) {
for (int i = 0; i < 3; i++) {
p_min[i] = std::min(v0[i], v1[i]);
p_max[i] = std::max(v0[i], v1[i]);
}
}
AABB::AABB(const Vector3f &v0, const Vector3f &v1, const Vector3f &v2) {
for (int i = 0; i < 3; i++) {
p_min[i] = std::min(std::min(v0[i], v1[i]), v2[i]);
p_max[i] = std::max(std::max(v0[i], v1[i]), v2[i]);
}
}
int AABB::maximum_extent() const {
Vector3f d = p_max - p_min;
if (d[0] > d[1] && d[0] > d[2]) {
return 0;
} else if (d[1] > d[2]) {
return 1;
} else {
return 2;
}
}
Vector3f AABB::offset(const Vector3f &p) const {
Vector3f o = p - p_min;
for (int i = 0; i < 3; i++) {
if (p_max[i] > p_min[i]) {
o[i] /= (p_max[i] - p_min[i]);
}
}
return o;
}
float AABB::surface_area() const {
Vector3f d = p_max - p_min;
return 2.f * (d[0] * d[1] + d[0] * d[2] + d[1] * d[2]);
}
std::pair<Vector3f, Vector3f> AABB::get_centered_form() const {
auto center = 0.5f * (p_min + p_max);
auto extent = 0.5f * (p_max - p_min);
return {center, extent};
}
bool AABB::below_plane(const Vector3f &position, const Vector3f &normal) const {
// Loop through 8 vertices, if anyone of them is above return false
for (int i = 0; i < 8; i++) {
if (dot(corner(i) - position, normal) > 1e-6f) {
return false;
}
}
return true;
}
inline auto gamma(int n) {
auto eps = std::numeric_limits<float>::epsilon() * 0.5;
return (n * eps) / (1 - n * eps);
}
bool AABB::intersect(const Ray &ray) const {
auto t0 = 0.f;
auto t1 = std::numeric_limits<float>::infinity();
for (int i = 0; i < 3; ++i) {
// Update interval for _i_th bounding box slab
auto invRayDir = 1.f / ray.dir[i];
auto tNear = (p_min[i] - ray.org[i]) * invRayDir;
auto tFar = (p_max[i] - ray.org[i]) * invRayDir;
// Update parametric interval from slab intersection $t$ values
if (tNear > tFar) {
std::swap(tNear, tFar);
}
// Update _tFar_ to ensure robust ray--bounds intersection
tFar *= 1 + 2 * gamma(3);
t0 = tNear > t0 ? tNear : t0;
t1 = tFar < t1 ? tFar : t1;
if (t0 > t1) return false;
}
return true;
}
// From GeometricTools (Boost license)
// https://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrAlignedBox3Cone3.h
struct ConeIntersector {
ConeIntersector() {
// The vector z[] stores the box coordinates of the cone vertex, z[i] =
// Dot(box.axis[i],cone.vertex-box.center). Each mPolygon[] has a comment
// with signs: s[0] s[1] s[2]. If the sign is '-', z[i] < -e[i]. If the
// sign is '+', z[i] > e[i]. If the sign is '0', |z[i]| <= e[i].
polygons[0] = { 6,{ { 1, 5, 4, 6, 2, 3 } } }; // ---
polygons[1] = { 6,{ { 0, 2, 3, 1, 5, 4 } } }; // 0--
polygons[2] = { 6,{ { 0, 2, 3, 7, 5, 4 } } }; // +--
polygons[3] = { 6,{ { 0, 4, 6, 2, 3, 1 } } }; // -0-
polygons[4] = { 4,{ { 0, 2, 3, 1 } } }; // 00-
polygons[5] = { 6,{ { 0, 2, 3, 7, 5, 1 } } }; // +0-
polygons[6] = { 6,{ { 0, 4, 6, 7, 3, 1 } } }; // -+-
polygons[7] = { 6,{ { 0, 2, 6, 7, 3, 1 } } }; // 0+-
polygons[8] = { 6,{ { 0, 2, 6, 7, 5, 1 } } }; // ++-
polygons[9] = { 6,{ { 0, 1, 5, 4, 6, 2 } } }; // --0
polygons[10] = { 4,{ { 0, 1, 5, 4 } } }; // 0-0
polygons[11] = { 6,{ { 0, 1, 3, 7, 5, 4 } } }; // +-0
polygons[12] = { 4,{ { 0, 4, 6, 2 } } }; // -00
polygons[13] = { 0,{ { 0 } } }; // 000
polygons[14] = { 4,{ { 1, 3, 7, 5 } } }; // +00
polygons[15] = { 6,{ { 0, 4, 6, 7, 3, 2 } } }; // -+0
polygons[16] = { 4,{ { 2, 6, 7, 3 } } }; // 0+0
polygons[17] = { 6,{ { 1, 3, 2, 6, 7, 5 } } }; // ++0
polygons[18] = { 6,{ { 0, 1, 5, 7, 6, 2 } } }; // --+
polygons[19] = { 6,{ { 0, 1, 5, 7, 6, 4 } } }; // 0-+
polygons[20] = { 6,{ { 0, 1, 3, 7, 6, 4 } } }; // +-+
polygons[21] = { 6,{ { 0, 4, 5, 7, 6, 2 } } }; // -0+
polygons[22] = { 4,{ { 4, 5, 7, 6 } } }; // 00+
polygons[23] = { 6,{ { 1, 3, 7, 6, 4, 5 } } }; // +0+
polygons[24] = { 6,{ { 0, 4, 5, 7, 3, 2 } } }; // -++
polygons[25] = { 6,{ { 2, 6, 4, 5, 7, 3 } } }; // 0++
polygons[26] = { 6,{ { 1, 3, 2, 6, 4, 5 } } }; // +++
}
bool operator()(const AABB &aabb, const Cone &cone) const {
if (cone.cos_angle <= 0.f) {
return true;
}
auto [center, extent] = aabb.get_centered_form();
// Quick-rejection test for boxes below the supporting plane of the cone.
Vector3f CmV = center - cone.ray.org;
float DdCmV = dot(cone.ray.dir, CmV); // interval center
float radius = // interval half-length
extent[0] * std::abs(cone.ray.dir[0]) +
extent[1] * std::abs(cone.ray.dir[1]) +
extent[2] * std::abs(cone.ray.dir[2]);
if (DdCmV + radius <= 0) {
// The box is in the halfspace below the supporting plane of the cone.
return false;
}
// Quick-rejection test for boxes outside the plane determined by the
// height of the cone.
// if (DdCmV - radius >= cone.ray.far) {
// // The box is outside the plane determined by the height of the
// // cone.
// return false;
// }
// Determine the box faces that are visible to the cone vertex. The
// box center has been translated (C-V) so that the cone vertex is at
// the origin. Compute the coordinates of the origin relative to the
// translated box.
int index[3] = {
(CmV[0] < -extent[0] ? 2 : (CmV[0] > extent[0] ? 0 : 1)),
(CmV[1] < -extent[1] ? 2 : (CmV[1] > extent[1] ? 0 : 1)),
(CmV[2] < -extent[2] ? 2 : (CmV[2] > extent[2] ? 0 : 1))
};
int lookup = index[0] + 3 * index[1] + 9 * index[2];
if (lookup == 13) {
return true;
}
return intersect(extent,
cone.cos_angle * cone.cos_angle,
cone.ray.dir,
CmV,
DdCmV,
lookup);
}
bool intersect(const Vector3f &extent,
const float squared_cos_angle,
const Vector3f &dir,
const Vector3f &CmV,
const float DdCmV,
const int lookup) const {
const Polygon &polygon = polygons[lookup];
// Test polygon points.
Vector3f X[8], PmV[8];
float DdPmV[8], sqrDdPmV[8], sqrLenPmV[8], q;
int iMax = -1, jMax = -1;
for (int i = 0; i < polygon.numPoints; ++i) {
int j = polygon.indices[i];
X[j][0] = (j & 1 ? extent[0] : -extent[0]);
X[j][1] = (j & 2 ? extent[1] : -extent[1]);
X[j][2] = (j & 4 ? extent[2] : -extent[2]);
DdPmV[j] = dot(dir, X[j]) + DdCmV;
if (DdPmV[j] > 0) {
PmV[j] = X[j] + CmV;
sqrDdPmV[j] = DdPmV[j] * DdPmV[j];
sqrLenPmV[j] = dot(PmV[j], PmV[j]);
q = sqrDdPmV[j] - squared_cos_angle * sqrLenPmV[j];
if (q > 0) {
return true;
}
// Keep track of the maximum in case we must process box edges.
// This supports the gradient ascent search.
if (iMax == -1 ||
sqrDdPmV[j] * sqrLenPmV[jMax] > sqrDdPmV[jMax] * sqrLenPmV[j]) {
iMax = i;
jMax = j;
}
}
}
// Theoretically, this function is called when the box has at least one corner
// above the supporting plane, in which case DdPmV[j] > 0 for at least one
// j and consequently iMax should not be -1. But in case of numerical
// rounding errors, return a no-intersection result if iMax is -1: the
// box is below the supporting plane within numerical rounding errors.
if (iMax == -1) {
return false;
}
// Start the gradient ascent search at index jMax.
float maxSqrLenPmV = sqrLenPmV[jMax];
float maxDdPmV = DdPmV[jMax];
Vector3f &maxX = X[jMax];
Vector3f &maxPmV = PmV[jMax];
int k0, k1, k2, jDiff;
float s, fder, numer, denom, DdMmV, det;
Vector3f MmV;
// Search the counterclockwise edge <corner[jMax],corner[jNext]>.
int iNext = (iMax < polygon.numPoints - 1 ? iMax + 1 : 0);
int jNext = polygon.indices[iNext];
jDiff = jNext - jMax;
s = (jDiff > 0 ? 1 : -1);
k0 = std::abs(jDiff) >> 1;
fder = s * (dir[k0] * maxSqrLenPmV - maxDdPmV * maxPmV[k0]);
if (fder > 0) {
// The edge has an interior local maximum in F because
// F(K[j0]) >= F(K[j1]) and the directional derivative of F at K0
// is positive. Compute the local maximum point.
k1 = (k0 + 1) % 3;
k2 = (k1 + 1) % 3;
numer = maxPmV[k1] * maxPmV[k1] + maxPmV[k2] * maxPmV[k2];
denom = dir[k1] * maxPmV[k1] + dir[k2] * maxPmV[k2];
MmV[k0] = numer * dir[k0];
MmV[k1] = denom * (maxX[k1] + CmV[k1]);
MmV[k2] = denom * (maxX[k2] + CmV[k2]);
// Theoretically, DdMmV > 0, so there is no need to test positivity.
DdMmV = dot(dir, MmV);
q = DdMmV * DdMmV - squared_cos_angle * dot(MmV, MmV);
if (q > 0) {
return true;
}
// Determine on which side of the spherical arc D lives on. If the
// polygon side, then the cone ray intersects the polygon and the cone
// and box intersect. Otherwise, the D is outside the polygon and the
// cone and box do not intersect.
det = s * (dir[k1] * maxPmV[k2] - dir[k2] * maxPmV[k1]);
return det <= 0;
}
// Search the clockwise edge <corner[jMax],corner[jPrev]>.
int iPrev = (iMax > 0 ? iMax - 1 : polygon.numPoints - 1);
int jPrev = polygon.indices[iPrev];
jDiff = jMax - jPrev;
s = (jDiff > 0 ? 1 : -1);
k0 = std::abs(jDiff) >> 1;
fder = -s * (dir[k0] * maxSqrLenPmV - maxDdPmV * maxPmV[k0]);
if (fder > 0) {
// The edge has an interior local maximum in F because
// F(K[j0]) >= F(K[j1]) and the directional derivative of F at K0
// is positive. Compute the local maximum point.
k1 = (k0 + 1) % 3;
k2 = (k1 + 1) % 3;
numer = maxPmV[k1] * maxPmV[k1] + maxPmV[k2] * maxPmV[k2];
denom = dir[k1] * maxPmV[k1] + dir[k2] * maxPmV[k2];
MmV[k0] = numer * dir[k0];
MmV[k1] = denom * (maxX[k1] + CmV[k1]);
MmV[k2] = denom * (maxX[k2] + CmV[k2]);
// Theoretically, DdMmV > 0, so there is no need to test positivity.
DdMmV = dot(dir, MmV);
q = DdMmV * DdMmV - squared_cos_angle * dot(MmV, MmV);
if (q > 0) {
return true;
}
// Determine on which side of the spherical arc D lives on. If the
// polygon side, then the cone ray intersects the polygon and the cone
// and box intersect. Otherwise, the D is outside the polygon and the
// cone and box do not intersect.
det = s * (dir[k1] * maxPmV[k2] - dir[k2] * maxPmV[k1]);
return det <= 0;
}
return false;
}
// The spherical polygons have vertices stored in counterclockwise order
// when viewed from outside the sphere. The 'indices' are lookups into
// {0..26}, where there are 27 possible spherical polygon configurations
// based on the location of the cone vertex related to the box.
struct Polygon {
int numPoints;
std::array<int, 6> indices;
};
std::array<Polygon, 27> polygons;
};
bool AABB::intersect(const Cone &cone) const {
static ConeIntersector cone_intersector;
return cone_intersector(*this, cone);
}
bool AABB::inside(const Vector3f &p) const {
return p[0] >= p_min[0] && p[0] <= p_max[0] &&
p[1] >= p_min[1] && p[1] <= p_max[1] &&
p[2] >= p_min[2] && p[2] <= p_max[2];
}
AABB merge(const AABB &b, const Vector3f &p) {
return AABB(make_vector3(std::min(b.p_min[0], p[0]),
std::min(b.p_min[1], p[1]),
std::min(b.p_min[2], p[2])),
make_vector3(std::max(b.p_max[0], p[0]),
std::max(b.p_max[1], p[1]),
std::max(b.p_max[2], p[2])));
}
AABB merge(const AABB &b0, const AABB &b1) {
return AABB(make_vector3(std::min(b0.p_min[0], b1.p_min[0]),
std::min(b0.p_min[1], b1.p_min[1]),
std::min(b0.p_min[2], b1.p_min[2])),
make_vector3(std::max(b0.p_max[0], b1.p_max[0]),
std::max(b0.p_max[1], b1.p_max[1]),
std::max(b0.p_max[2], b1.p_max[2])));
}
| 41.416667 | 88 | 0.479879 | [
"vector"
] |
7bf47f7a0b8456965c61f567c3682edcfe9b1963 | 819 | cpp | C++ | test/test_string.cpp | pmed/sqlitepp | f971d266069b3c836bc50da70f7129e6f77c0e15 | [
"BSL-1.0"
] | 20 | 2015-01-09T15:34:58.000Z | 2021-12-21T03:32:08.000Z | test/test_string.cpp | pmed/sqlitepp | f971d266069b3c836bc50da70f7129e6f77c0e15 | [
"BSL-1.0"
] | 2 | 2016-08-10T18:54:44.000Z | 2018-02-13T06:08:35.000Z | test/test_string.cpp | pmed/sqlitepp | f971d266069b3c836bc50da70f7129e6f77c0e15 | [
"BSL-1.0"
] | 4 | 2015-04-17T11:28:18.000Z | 2020-07-13T06:39:51.000Z | #include <tut.h>
#include <sqlitepp/string.hpp>
using namespace sqlitepp;
namespace tut {
struct string_data
{
string_t str_;
};
typedef tut::test_group<string_data> string_test_group;
typedef string_test_group::object object;
string_test_group str_g("1. string");
template<>template<>
void object::test<1>()
{
ensure("empty string", str_.empty());
}
template<>template<>
void object::test<2>()
{
sqlitepp::string_t s;
ensure("empty string", s.empty());
ensure_equals("strings", str_, s);
}
template<>template<>
void object::test<3>()
{
str_ = utf(L"1");
sqlitepp::string_t s(str_);
ensure_equals("strings", str_, s);
str_ = utf(L"2");
s = str_;
ensure_equals("strings", str_, s);
s.clear();
ensure("empty", s.empty());
}
} // namespace tut {
| 16.38 | 56 | 0.639805 | [
"object"
] |
7bf596614e55806f700a8bf215ff574cb8205358 | 2,759 | cpp | C++ | Demos/ODFAEG-CLIENT/hero.cpp | Ornito/ODFAEG-1 | f563975ae4bdd2e178d1ed7267e1920425aa2c4d | [
"Zlib"
] | null | null | null | Demos/ODFAEG-CLIENT/hero.cpp | Ornito/ODFAEG-1 | f563975ae4bdd2e178d1ed7267e1920425aa2c4d | [
"Zlib"
] | null | null | null | Demos/ODFAEG-CLIENT/hero.cpp | Ornito/ODFAEG-1 | f563975ae4bdd2e178d1ed7267e1920425aa2c4d | [
"Zlib"
] | null | null | null | #include "hero.h"
namespace sorrok {
using namespace odfaeg::core;
using namespace odfaeg::graphic::gui;
Hero::Hero(std::string factionName, std::string name, std::string sex, std::string currentMapName, std::string hairColor,
std::string eyesColor, std::string skinColor, std::string faceType, std::string classs, int level)
: Caracter("E_HERO", name, currentMapName, classs, level) {
this->factionName = factionName;
this->sex = sex;
this->hairColor = hairColor;
this->eyesColor = eyesColor;
this->skinColor = skinColor;
this->faceType = faceType;
xp = 0;
xpReqForNextLevel = 1500;
moveFromKeyboard = false;
job = Hero::Job::Novice;
}
void Hero::addItem(Item item) {
std::map<Item::Type, std::vector<Item>>::iterator it;
it = inventory.find(item.getType());
if (it != inventory.end()) {
it->second.push_back(item);
} else {
std::vector<Item> items;
items.push_back(item);
inventory.insert(std::make_pair(item.getType(), items));
}
}
bool Hero::isMovingFromKeyboard() {
return moveFromKeyboard;
}
void Hero::setCurrentXp(int xp) {
this->xp = xp;
}
void Hero::setXpReqForNextLevel(int xpReqForNextLevel) {
this->xpReqForNextLevel = xpReqForNextLevel;
}
void Hero::up (int xp) {
this->xp += xp;
if (this->xp >= xpReqForNextLevel) {
setLevel(getLevel() + 1);
this->xp = this->xp - xpReqForNextLevel;
xpReqForNextLevel *= 1.1f;
}
}
int Hero::getCurrentXp () {
return xp;
}
int Hero::getXpReqForNextLevel () {
return xpReqForNextLevel;
}
void Hero::setIsMovingFromKeyboard(bool b) {
moveFromKeyboard = b;
}
std::map<Item::Type, std::vector<Item>>& Hero::getInventory() {
return inventory;
}
Variant<Hero::Novice, Hero::Warrior, Hero::Magician, Hero::Thief> Hero::getJobVariant() {
switch(job) {
case Hero::Job::Novice : return Variant<Hero::Novice, Hero::Warrior, Hero::Magician, Hero::Thief>(Hero::Novice());
case Hero::Job::Warrior : return Variant<Hero::Novice, Hero::Warrior, Hero::Magician, Hero::Thief>(Hero::Warrior());
case Hero::Job::Magician : return Variant<Hero::Novice, Hero::Warrior, Hero::Magician, Hero::Thief>(Hero::Magician());
case Hero::Job::Thief : return Variant<Hero::Novice, Hero::Warrior, Hero::Magician, Hero::Thief>(Hero::Thief());
}
}
Hero::Job Hero::getJobType() {
std::cout<<"job : "<<(int) job<<std::endl;
return job;
}
Hero::~Hero() {
}
}
| 37.283784 | 130 | 0.587894 | [
"vector"
] |
7bf5e04e45f2f7a7c653b50949653471ba3161f1 | 19,179 | cpp | C++ | keyvi/3rdparty/tpie/apps/spatial_join/pbsmj.cpp | remusao/keyvi | 7ea51e4ae94d355c677cce349a1c17290f24252c | [
"Apache-2.0"
] | 147 | 2015-10-06T19:10:01.000Z | 2021-08-19T07:52:02.000Z | keyvi/3rdparty/tpie/apps/spatial_join/pbsmj.cpp | remusao/keyvi | 7ea51e4ae94d355c677cce349a1c17290f24252c | [
"Apache-2.0"
] | 148 | 2015-10-06T09:24:56.000Z | 2018-12-08T08:42:54.000Z | keyvi/3rdparty/tpie/apps/spatial_join/pbsmj.cpp | remusao/keyvi | 7ea51e4ae94d355c677cce349a1c17290f24252c | [
"Apache-2.0"
] | 34 | 2015-10-09T06:55:52.000Z | 2021-01-05T18:43:57.000Z | // -*- mode: c++; tab-width: 4; indent-tabs-mode: t; c-file-style: "stroustrup"; -*-
// vi:set ts=4 sts=4 sw=4 noet :
// Copyright 2008, The TPIE development team
//
// This file is part of TPIE.
//
// TPIE 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.
//
// TPIE 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 Lesser General Public
// License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with TPIE. If not, see <http://www.gnu.org/licenses/>
// Copyright (c) 1997 Octavian Procopiuc
//
// File: pbsmj.cpp
// Author: Octavian Procopiuc <tavi@cs.duke.edu>
// Created: 03/30/97
// Last Modified: 01/28/99
//
// $Id: pbsmj.cpp,v 1.3 2005-11-10 10:35:57 adanner Exp $
//
// Rectangle intersection using the alg. of Patel and DeWitt.
//
#include <iostream>
#include <fstream>
using std::ifstream;
using std::ofstream;
using std::istream;
using std::ostream;
using std::cerr;
using std::cout;
using std::endl;
#include <stdlib.h>
#include <string.h>
#include "app_config.h"
#include <ami.h>
#include "rectangle.h"
#include "striped.h"
#include <ami_scan_utils.h>
#include "parse_args.h"
#include "intertree.h"
#include "joinlog.h"
#include <algorithm>
bool verbose = false;
TPIE_OS_SIZE_T test_mm_size = 64*1024*1024; // Default mem. size.
TPIE_OS_OFFSET test_size = 0; // Not used.
int random_seed = 17;
#define MAX_NAME_LEN 128
// Sweeping algorithms:
#define ORIGINAL 1
#define STRIPED 2
#define TREE 3
static char def_if_red[] = "rectangles.red";
static char def_if_blue[] = "rectangles.blue";
static char def_of[] = "output";
static char *input_filename_red = def_if_red;
static char *input_filename_blue = def_if_blue;
static char *output_filename = def_of;
extern int register_new;
static TPIE_OS_SIZE_T part_count;
// Default sweeping algorithm.
static int algorithm = ORIGINAL;
static struct options as_opts[]={
{ 5, "red", "Red input Stream", "R", 1 },
{ 6, "blue", "Blue input Stream", "B", 1 },
{ 7, "out", "Output file name", "o", 1 },
{ 8, "part", "Part Count", "p", 1 },
{ 9, "algo", "Algorithm Type (1-3)", "a", 1 },
};
void parse_app_opt(int idx, char *optarg)
{
switch (idx) {
case 5:
input_filename_red = optarg;
break;
case 6:
input_filename_blue = optarg;
break;
case 7:
output_filename = optarg;
break;
case 8:
part_count = atol(optarg);
//istrstream(optarg,strlen(optarg)) >> part_count;
break;
case 9:
algorithm = atol(optarg);
//istrstream(optarg,strlen(optarg)) >> algorithm;
if ((algorithm != ORIGINAL) && (algorithm != STRIPED) && (algorithm != TREE)) {
cerr << "Invalid algorithm choice.\n";
exit(-1);
}
break;
}
}
extern "C" {void UsageStart(); void UsageEnd(char *);}
// Scan management object for finding intersections using
// interval trees.
class inter_rect : AMI_scan_object {
InterTree *inter0;
InterTree *inter1;
randInfo rand;
AMI_STREAM<pair_of_rectangles> *outStream;
public:
unsigned long intersection_count;
inter_rect(AMI_STREAM<pair_of_rectangles> *output,
int randseed = random_seed): rand(randseed), outStream(output)
{
inter0 = NULL;
inter1 = NULL;
}
AMI_err initialize(void) {
if (inter0 != NULL)
delete inter0;
if (inter1 != NULL)
delete inter1;
inter0 = new InterTree(0);
inter1 = new InterTree(1);
intersection_count = 0;
return AMI_ERROR_NO_ERROR;
};
AMI_err operate(const rectangle &in0, const rectangle &in1, AMI_SCAN_FLAG *sfin)
{
if (sfin[0] && sfin[1]) {
if (in0.ylo < in1.ylo) { // consume in0
sfin[1] = false;
inter1->DeleteOld(in0.ylo);
intersection_count += inter1->Search(in0, outStream);
inter0->Insert(in0, &rand);
} else {
sfin[0] = false;
inter0->DeleteOld(in1.ylo);
intersection_count += inter0->Search(in1, outStream);
inter1->Insert(in1, &rand);
}
} else if (!sfin[0]) {
if (!sfin[1]) {
return AMI_SCAN_DONE;
} else {// we only have in1
inter0->DeleteOld(in1.ylo);
intersection_count += inter0->Search(in1, outStream);
}
} else { // we only have in0
inter1->DeleteOld(in0.ylo);
intersection_count += inter1->Search(in0, outStream);
}
return AMI_SCAN_CONTINUE;
}
// method to scan from an array.
TPIE_OS_OFFSET inMemoryScan(rectangle* red_a, TPIE_OS_OFFSET red_l,
rectangle* blue_a, TPIE_OS_OFFSET blue_l)
{
TPIE_OS_OFFSET red_i, blue_i;
rectangle r;
if (inter0 != NULL)
delete inter0;
if (inter1 != NULL)
delete inter1;
inter0 = new InterTree(0);
inter1 = new InterTree(1);
intersection_count = 0;
red_i = blue_i = 0;
while (true) {
if (red_i < red_l && blue_i < blue_l) {
if (red_a[red_i].ylo < blue_a[blue_i].ylo) {
r = red_a[red_i++];
inter1->DeleteOld(r.ylo);
intersection_count += inter1->Search(r, outStream);
inter0->Insert(r, &rand);
} else {
r = blue_a[blue_i++];
inter0->DeleteOld(r.ylo);
intersection_count += inter0->Search(r, outStream);
inter1->Insert(r, &rand);
}
} else if (red_i >= red_l) {
if (blue_i >= blue_l) {
break;
} else {
r = blue_a[blue_i++];
inter0->DeleteOld(r.ylo);
intersection_count += inter0->Search(r, outStream);
}
} else { // blue_i >= blue_l
r = red_a[red_i++];
inter1->DeleteOld(r.ylo);
intersection_count += inter1->Search(r, outStream);
}
}
delete inter0;
delete inter1;
return intersection_count;
}
};
// Scan management object that distributes data in tiles.
class Distributor : AMI_scan_object {
AMI_STREAM<rectangle> **red_parts;
AMI_STREAM<rectangle> **blue_parts;
TPIE_OS_SIZE_T tile_count_row, tile_count_col, part_count;
double tile_height, tile_width;
rectangle mbr, tile;
bool *written;
public:
Distributor(rectangle ambr,
TPIE_OS_SIZE_T tcr, TPIE_OS_SIZE_T tcc, TPIE_OS_SIZE_T pc) :mbr(ambr)
{
tile_count_row = tcr; tile_count_col = tcc; part_count = pc;
red_parts = new AMI_STREAM<rectangle>*[pc];
blue_parts = new AMI_STREAM<rectangle>*[pc];
tile_height = (double) (mbr.yhi - mbr.ylo) / tile_count_row;
tile_width = (double) (mbr.xhi - mbr.xlo) / tile_count_col;
written = new bool[part_count];
}
~Distributor()
{
TPIE_OS_SIZE_T i;
delete [] written;
for (i = 0; i < part_count; i++) {
delete red_parts[i];
delete blue_parts[i];
}
delete [] red_parts;
delete [] blue_parts;
}
AMI_err process(const rectangle &r, int isRed)
{
// round robin.
TPIE_OS_SIZE_T i, j, rowLow, colLow, rowHigh, colHigh;
for (i=0; i<part_count; i++)
written[i] = false;
rowLow = (TPIE_OS_SIZE_T) ceil((r.ylo - mbr.ylo) / tile_height) - 1;
rowLow = (rowLow > 0) ? rowLow: 0;
rowHigh = (TPIE_OS_SIZE_T) floor((r.yhi - mbr.ylo) / tile_height);
colLow = (TPIE_OS_SIZE_T) ceil((r.xlo - mbr.xlo) / tile_width) - 1;
colLow = (colLow > 0) ? colLow : 0;
colHigh = (TPIE_OS_SIZE_T) floor((r.xhi - mbr.xlo) / tile_width);
for (i = rowLow; i <= rowHigh; i++) {
//cout << "i:" << i << endl;
for (j = i*tile_count_row+colLow; j <= i*tile_count_row+colHigh; j++) {
//cout << "j: " << j << endl;
if (!written[j % part_count]) {
written[j % part_count] = true;
if (isRed)
red_parts[j % part_count]->write_item(r);
else
blue_parts[j % part_count]->write_item(r);
}
}
}
/*
// new version, dumber. untested.
int i, j;
for (i=0; i<part_count; i++)
written[i] = false;
for (i = 0; i < tile_count_row; i++) {
for (j = 0; j < tile_count_col; j++) {
tile = rectangle(0, mbr.xlo + j*tile_width, mbr.ylo + i*tile_height,
mbr.xlo + (j+1)*tile_width, mbr.ylo + (i+1)*tile_height);
if (tile.intersects(r) && !written[(j+i*tile_count_col) % part_count]) {
written[(j+i*tile_count_col) % part_count] = true;
if (isRed)
red_parts[(j+i*tile_count_col) % part_count]->write_item(r);
else
blue_parts[(j+i*tile_count_col) % part_count]->write_item(r);
}
}
}
*/
return AMI_ERROR_NO_ERROR;
}
AMI_err initialize(void)
{
TPIE_OS_SIZE_T i;
for (i = 0; i < part_count; i++) {
red_parts[i] = new AMI_STREAM<rectangle>;
red_parts[i]->persist(PERSIST_PERSISTENT);
blue_parts[i] = new AMI_STREAM<rectangle>;
blue_parts[i]->persist(PERSIST_PERSISTENT);
}
//cout << "Initialized distributor.\n";
return AMI_ERROR_NO_ERROR;
}
AMI_err operate(const rectangle &in0, const rectangle &in1, AMI_SCAN_FLAG *sfin)
{
//cout << "Entering operate\n";
if (sfin[0] && sfin[1]) {
process(in0, 1); // red rect.
//cout << "processed:" << in0 << endl;
process(in1, 0); // blue rect.
//cout << "processed:" << in1 << endl;
} else if (!sfin[0]) {
if (sfin[1])
process(in1, 0);
else {
return AMI_SCAN_DONE;
}
} else
process(in0, 1);
return AMI_SCAN_CONTINUE;
}
AMI_STREAM<rectangle> **get_red_parts() { return red_parts; }
AMI_STREAM<rectangle> **get_blue_parts() { return blue_parts; }
};
// Scan management object that reads data from a stream into an array.
class Reader: AMI_scan_object {
protected:
rectangle *array;
unsigned long current;
public:
Reader()
{
array = NULL;
}
void setArray(rectangle *a)
{
array = a;
}
AMI_err initialize(void)
{
current = 0;
return AMI_ERROR_NO_ERROR;
}
AMI_err operate(const rectangle &in, AMI_SCAN_FLAG *sfin)
{
if (*sfin) {
array[current++] = in;
return AMI_SCAN_CONTINUE;
} else
return AMI_SCAN_DONE;
}
};
// Implements the original PBSM sweeping algorithms.
// Returns the number of intersections found.
TPIE_OS_OFFSET pseudoScan(rectangle* red_a, TPIE_OS_OFFSET red_l,
rectangle* blue_a, TPIE_OS_OFFSET blue_l,
AMI_STREAM<pair_of_rectangles> *outStream)
{
rectangle rr, br;
TPIE_OS_OFFSET i, red_st, blue_st, intersection_count;
pair_of_rectangles intersection;
red_st = blue_st = intersection_count = 0;
while (red_st < red_l && blue_st < blue_l) {
if (red_a[red_st].ylo < blue_a[blue_st].ylo) { //take the red one
rr = red_a[red_st++];
for (i = blue_st; i < blue_l; i++) {
if ((br = blue_a[i]).ylo > rr.yhi)
break;
if ((rr.xlo <= br.xlo && br.xlo <= rr.xhi) ||
(br.xlo <= rr.xlo && rr.xlo <= br.xhi)) {
intersection.first = rr.id; intersection.second = br.id;
outStream->write_item(intersection);
intersection_count++;
}
}
} else {
br = blue_a[blue_st++];
for (i = red_st; i < red_l; i++) {
if ((rr = red_a[i]).ylo > br.yhi)
break;
if ((rr.xlo <= br.xlo && br.xlo <= rr.xhi) ||
(br.xlo <= rr.xlo && rr.xlo <= br.xhi)) {
intersection.first = rr.id; intersection.second = br.id;
outStream->write_item(intersection);
intersection_count++;
}
}
}
}
return intersection_count;
}
// Try to get the mbr of a stream of rectangles
// using the ".mbr" meta file.
void getMbr(char *input_filename, rectangle *mbr) {
// Add suffix ".mbr" to the input file name.
char *mbr_filename = new char[strlen(input_filename)+5];
strcpy(mbr_filename, input_filename);
mbr_filename = strcat(mbr_filename, ".mbr");
// Read the mbr.
ifstream *mbr_file_stream = new ifstream(mbr_filename);
if (!(*mbr_file_stream))
cerr << "Error: couldn't open " << mbr_filename << endl;
else
mbr_file_stream->read((char *) mbr, sizeof(rectangle));
delete mbr_file_stream;
delete [] mbr_filename;
}
TPIE_OS_SIZE_T computePartitionCount(TPIE_OS_OFFSET rect_count) {
TPIE_OS_SIZE_T p;
TPIE_OS_SIZE_T sz_avail;
TPIE_OS_OFFSET sz_of_all_rects;
sz_avail = MM_manager.memory_available();
// MM_manager.available(&sz_avail);
TPIE_OS_OFFSET space_needed, prev_space_needed = 0;
sz_of_all_rects = sizeof(rectangle) * (rect_count);
for (p = 1; 1; p++) {
space_needed = p*(sz_avail - 2*p*(MAX_NAME_LEN + 2*sizeof(char *)));
if (space_needed <= prev_space_needed) { // went too far.
p--;
break;
} else
prev_space_needed = space_needed;
if (space_needed > sz_of_all_rects)
break;
}
return p;
}
// Sets things up, runs the distribution procedure,
// and runs the apropriate join procedure.
void pbsmJoin()
{
char **name_array_red, **name_array_blue;
AMI_STREAM<rectangle> **red_parts, **blue_parts;
AMI_STREAM<rectangle> *input_stream_red, *input_stream_blue;
rectangle mbr_red, mbr_blue, mbr;
Distributor *distributor;
Reader *reader;
TPIE_OS_SIZE_T sz_avail;
TPIE_OS_SIZE_T tile_count_row, tile_count_col, i;
cerr << "*******\tPBSM Join ("
<< (algorithm==STRIPED?"STRIPED":(algorithm==ORIGINAL?"ORIGINAL":"TREE"))
<< ")\t*******\n";
cerr << "Memory size set to " << static_cast<TPIE_OS_OUTPUT_SIZE_T>(test_mm_size) << " bytes.\n";
// Create the input streams.
input_stream_red = new AMI_STREAM<rectangle>(input_filename_red, AMI_READ_STREAM);
input_stream_red->persist(PERSIST_PERSISTENT);
input_stream_blue = new AMI_STREAM<rectangle>(input_filename_blue, AMI_READ_STREAM);
input_stream_blue->persist(PERSIST_PERSISTENT);
JoinLog jl("PBSM",
input_filename_red, input_stream_red->stream_len(),
input_filename_blue, input_stream_blue->stream_len());
cerr << "Initial Stream length: "
<< input_stream_red->stream_len()+input_stream_blue->stream_len() << endl;
// Get the mbrs of the red and blue rectangles from the .mbr files.
getMbr(input_filename_red, &mbr_red);
getMbr(input_filename_blue, &mbr_blue);
// Compute the mbr of the above 2 mbrs.
mbr = rectangle(0, ((mbr_red.xlo < mbr_blue.xlo) ? mbr_red.xlo : mbr_blue.xlo),
((mbr_red.ylo < mbr_blue.ylo) ? mbr_red.ylo : mbr_blue.ylo),
((mbr_red.xhi > mbr_blue.xhi) ? mbr_red.xhi : mbr_blue.xhi),
((mbr_red.yhi > mbr_blue.yhi) ? mbr_red.yhi : mbr_blue.yhi));
jl.UsageStart();
tile_count_row = 128;//32;
tile_count_col = 128;//32;
sz_avail = MM_manager.memory_available();
//MM_manager.available(&sz_avail);
//cerr << "Before: " << sz_avail << endl;
// Compute the # of partitions.
part_count = computePartitionCount(input_stream_red->stream_len() +
input_stream_blue->stream_len());
cerr << "Partitions: " << static_cast<TPIE_OS_OUTPUT_SIZE_T>(part_count) << endl;
// cout << "Avail. Mem. Before Distribution: " << sz_avail << endl;
if (part_count > 1) {
distributor = new Distributor(mbr, tile_count_row, tile_count_col, part_count);
AMI_scan(input_stream_red, input_stream_blue, distributor);
// Get the names of the partition files.
name_array_red = new char*[part_count];
name_array_blue = new char*[part_count];
red_parts = distributor->get_red_parts();
blue_parts = distributor->get_blue_parts();
for (i = 0; i < part_count; i++) {
red_parts[i]->name(&name_array_red[i]);
cerr << " r" << red_parts[i]->stream_len();
blue_parts[i]->name(&name_array_blue[i]);
cerr << " b" << blue_parts[i]->stream_len();
}
delete distributor;
} else {
red_parts = new (AMI_STREAM<rectangle> *);
blue_parts = new (AMI_STREAM<rectangle> *);
red_parts[0] = input_stream_red;
blue_parts[0] = input_stream_blue;
}
sz_avail = MM_manager.memory_available();
// MM_manager.available(&sz_avail);
cerr << "Finished distribution. Avail. mem: " << static_cast<TPIE_OS_OUTPUT_SIZE_T>(sz_avail) << endl;
// *******************************************************//
rectangle *red_array, *blue_array;
TPIE_OS_OFFSET red_length, blue_length;
AMI_STREAM<pair_of_rectangles> *outStream;
inter_rect *interObj;
TPIE_OS_OFFSET intersection_count = 0;
outStream = new AMI_STREAM<pair_of_rectangles>(output_filename);
outStream->persist(PERSIST_PERSISTENT);
if (algorithm == TREE)
interObj = new inter_rect(outStream, 12345);
if (algorithm == STRIPED) {
cerr << "Striped PBSM disabled. Aborting.\n";
return;
}
reader = new Reader;
if (part_count > 1) {
red_parts = new AMI_STREAM<rectangle>*[part_count];
blue_parts = new AMI_STREAM<rectangle>*[part_count];
}
// Loop thru the partitions.
for (i = 0; i < part_count; i++) {
cerr << "loading partition " << static_cast<TPIE_OS_OUTPUT_SIZE_T>(i) << endl;
// Get the 2 streams for the ith partition.
if (part_count > 1) {
red_parts[i] = new AMI_STREAM<rectangle>(name_array_red[i]);
blue_parts[i] = new AMI_STREAM<rectangle>(name_array_blue[i]);
red_parts[i]->persist(PERSIST_DELETE);
blue_parts[i]->persist(PERSIST_DELETE);
}
cerr << "opened the streams " << name_array_red[i] << " and " << name_array_blue[i] << endl;
// Read red rectangles into red_array
red_length = red_parts[i]->stream_len();
red_array = new rectangle[(TPIE_OS_SIZE_T)red_length];
reader->setArray(red_array);
AMI_scan(red_parts[i], reader);
delete red_parts[i];
// Read blue rectangles into red_array
blue_length = blue_parts[i]->stream_len();
blue_array = new rectangle[(TPIE_OS_SIZE_T)blue_length];
reader->setArray(blue_array);
AMI_scan(blue_parts[i], reader);
delete blue_parts[i];
//cerr << "lengths: " << red_length << " " << blue_length << endl;
// Sort the two arrays in memory.
sort(red_array, red_array+red_length);
sort(blue_array, blue_array+blue_length);
if (algorithm == ORIGINAL) {
intersection_count += pseudoScan(red_array, red_length,
blue_array, blue_length, outStream);
} else if (algorithm == TREE) {
intersection_count += interObj->inMemoryScan(red_array, red_length,
blue_array, blue_length);
} else {
// Should never reach this line.
cerr << " Error: invalid algorithm value!\n";
}
delete [] red_array;
delete [] blue_array;
}
delete reader;
delete outStream;
jl.UsageEnd("PBSM Intersection:", intersection_count);
if (verbose) {
cerr << "Intersection stream length: "
<< intersection_count << endl;
cerr << "******\tDone PBSM Join\t******\n\n";
}
}
int main(int argc, char **argv)
{
// register_new = 0;
MM_manager.warn_memory_limit();
verbose = true;
part_count = 4;
if(argc < 2){
cout << "Usage: pbsmjoin [ -R <red_input_file_name> ] "
<< "[ -B <blue_input_file_name> ]\n"
<< "\t[ -o <output_file_name> ] [ -p <part_count> ]"
<< "\t[ -m <memory_size> ] [ -a <algorithm> ]\n"
<< "Algorithm can be 1, 2, or 3:\n"
<< "\t1: ORIGINAL, 2: STRIPED, 3: TREE." << endl;
exit(0);
}
parse_args(argc,argv,as_opts,parse_app_opt);
MM_manager.set_memory_limit(test_mm_size);
pbsmJoin();
}
| 29.827372 | 104 | 0.646749 | [
"object"
] |
7bf6fdbaf74a8dd946895ec41d990f1d3642d047 | 8,951 | cc | C++ | seurat/mesh/mesh_component_util_test.cc | Asteur/vrhelper | 7b20ac69265ca7390a6c7f52a4f25b0fe87d0b53 | [
"Apache-2.0"
] | 819 | 2018-05-04T20:43:55.000Z | 2022-03-22T01:21:24.000Z | seurat/mesh/mesh_component_util_test.cc | mebalzer/seurat | 78c1293debdd2744cba11395024812f277f613f7 | [
"Apache-2.0"
] | 35 | 2018-05-05T03:50:16.000Z | 2019-11-04T22:56:02.000Z | seurat/mesh/mesh_component_util_test.cc | mebalzer/seurat | 78c1293debdd2744cba11395024812f277f613f7 | [
"Apache-2.0"
] | 88 | 2018-05-04T20:53:42.000Z | 2022-03-05T03:50:07.000Z | /*
Copyright 2017 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "seurat/mesh/mesh_component_util.h"
#include <array>
#include <random>
#include "ion/math/vector.h"
#include "gtest/gtest.h"
#include "seurat/base/ion_util_no_gl.h"
#include "seurat/geometry/mesh.h"
using ion::math::Point3f;
using ion::math::Vector3f;
using seurat::geometry::Mesh;
namespace seurat {
namespace mesh {
namespace {
TEST(MeshComponentUtilTest, TestCreateCube) {
ion::gfx::ImagePtr texture =
base::CreateImage(ion::gfx::Image::kRgba8888, {16, 16});
const auto cube = MeshComponentUtil::CreateCube(texture);
const auto attrs = cube->GetAttributeBuffer();
const auto tri_indices = cube->GetIndexBuffer();
// A cube should have 6 faces, each with 2 triangles consisting of 3 vertices.
EXPECT_EQ(6 * 2 * 3, tri_indices.size());
// The cube should be unit-sized and origin-centered.
EXPECT_EQ(Vector3f(1.0f, 1.0f, 1.0f), cube->GetBoundingBox().GetSize());
EXPECT_EQ(Point3f::Zero(), cube->GetBoundingBox().GetCenter());
}
TEST(MeshComponentUtilTest, TestCubeFaceOrientation) {
ion::gfx::ImagePtr texture =
base::CreateImage(ion::gfx::Image::kRgba8888, {16, 16});
const auto cube = MeshComponentUtil::CreateCube(texture);
const auto attrs = cube->GetAttributeBuffer();
const auto tri_indices = cube->GetIndexBuffer();
for (int tri_idx = 0; tri_idx < tri_indices.size() / 3; ++tri_idx) {
const auto& attr0 = attrs[tri_indices[tri_idx * 3 + 0]];
const auto& attr1 = attrs[tri_indices[tri_idx * 3 + 1]];
const auto& attr2 = attrs[tri_indices[tri_idx * 3 + 2]];
const Point3f center =
(attr0.position + attr1.position + attr2.position) / 3.0f;
// If 0->1->2 form a counter-clockwise triangle, then this normal should
// face the outside of the cube, in the opposite direction of the
// triangle-center->origin vector.
const Vector3f normal = ion::math::Cross(attr2.position - attr1.position,
attr0.position - attr1.position);
EXPECT_GT(0.0f, ion::math::Dot(normal, center - Point3f::Zero()));
}
}
TEST(MeshComponentUtilTest, ToMesh) {
ion::gfx::ImagePtr texture =
base::CreateImage(ion::gfx::Image::kRgba8888, {2, 2});
// Generate a 1x1 square mesh in the xy-plane.
const auto component = MeshComponent::Create(
"1x1_square", texture,
{
{Point3f(0.0f, 0.0f, 0.0f), Point3f(0.0f, 0.0f, 1.0f)},
{Point3f(1.0f, 0.0f, 0.0f), Point3f(1.0f, 0.0f, 1.0f)},
{Point3f(0.0f, 1.0f, 0.0f), Point3f(0.0f, 1.0f, 1.0f)},
{Point3f(1.0f, 1.0f, 0.0f), Point3f(1.0f, 1.0f, 1.0f)},
},
{0, 1, 3, 0, 3, 2});
Mesh mesh = MeshComponentUtil::ToMesh(*component);
EXPECT_EQ(4, mesh.GetVertexCount());
EXPECT_EQ(2, mesh.GetTriangleCount());
EXPECT_EQ((std::vector<Mesh::Triangle>{Mesh::Triangle{{0, 1, 3}},
Mesh::Triangle{{0, 3, 2}}}),
mesh.GetTriangles());
EXPECT_EQ((std::vector<Point3f>{
Point3f(0.0f, 0.0f, 0.0f), Point3f(1.0f, 0.0f, 0.0f),
Point3f(0.0f, 1.0f, 0.0f), Point3f(1.0f, 1.0f, 0.0f)}),
mesh.GetPositions());
EXPECT_EQ((std::vector<Point3f>{
Point3f(0.0f, 0.0f, 1.0f), Point3f(1.0f, 0.0f, 1.0f),
Point3f(0.0f, 1.0f, 1.0f), Point3f(1.0f, 1.0f, 1.0f)}),
mesh.GetTexCoords(0));
}
TEST(MeshComponentUtilTest, FromMesh) {
ion::gfx::ImagePtr texture =
base::CreateImage(ion::gfx::Image::kRgba8888, {2, 2});
Mesh mesh(1);
mesh.AppendVertex(Point3f(0.0f, 0.0f, 0.0f), {Point3f(0.0f, 0.0f, 1.0f)});
mesh.AppendVertex(Point3f(1.0f, 0.0f, 0.0f), {Point3f(1.0f, 0.0f, 1.0f)});
mesh.AppendVertex(Point3f(0.0f, 1.0f, 0.0f), {Point3f(0.0f, 1.0f, 1.0f)});
mesh.AppendVertex(Point3f(1.0f, 1.0f, 0.0f), {Point3f(1.0f, 1.0f, 1.0f)});
mesh.AppendTriangle(Mesh::Triangle{{0, 1, 3}});
mesh.AppendTriangle(Mesh::Triangle{{0, 3, 2}});
const auto component = MeshComponentUtil::FromMesh(mesh, texture);
EXPECT_EQ(4U, component->GetAttributeBuffer().size());
EXPECT_EQ(6U, component->GetIndexBuffer().size());
std::vector<MeshComponent::VertexAttributes> expected_attribute_buffer{
{Point3f(0.0f, 0.0f, 0.0f), Point3f(0.0f, 0.0f, 1.0f)},
{Point3f(1.0f, 0.0f, 0.0f), Point3f(1.0f, 0.0f, 1.0f)},
{Point3f(0.0f, 1.0f, 0.0f), Point3f(0.0f, 1.0f, 1.0f)},
{Point3f(1.0f, 1.0f, 0.0f), Point3f(1.0f, 1.0f, 1.0f)}};
EXPECT_EQ(expected_attribute_buffer, component->GetAttributeBuffer());
std::vector<uint32> expected_index_buffer{{0, 1, 3, 0, 3, 2}};
EXPECT_EQ(expected_index_buffer, component->GetIndexBuffer());
}
TEST(MeshComponentUtilTest, SortTrianglesByDistanceToEye) {
ion::gfx::ImagePtr texture =
base::CreateImage(ion::gfx::Image::kRgba8888, {16, 16});
// Two parallel triangles on the z=1 and z=2 planes.
const auto original_mesh = MeshComponent::Create(
"parallel_triangles", texture,
{
{Point3f(0.0f, 0.0f, 1.0f), Point3f(0.0f, 0.0f, 1.0f)},
{Point3f(1.0f, 0.0f, 1.0f), Point3f(1.0f, 0.0f, 1.0f)},
{Point3f(0.0f, 1.0f, 1.0f), Point3f(0.0f, 1.0f, 1.0f)},
{Point3f(0.0f, 0.0f, 2.0f), Point3f(0.0f, 0.0f, 1.0f)},
{Point3f(1.0f, 0.0f, 2.0f), Point3f(1.0f, 0.0f, 1.0f)},
{Point3f(0.0f, 1.0f, 2.0f), Point3f(0.0f, 1.0f, 1.0f)},
},
{0, 1, 2, 3, 4, 5});
const auto sorted_increasing =
MeshComponentUtil::SortTrianglesByDistanceToEye(
*original_mesh, Point3f(0.0f, 0.0f, 0.0f),
MeshComponentUtil::SortingOrder::kFrontToBack);
{
const std::vector<uint32>& index_buf = sorted_increasing->GetIndexBuffer();
const std::vector<MeshComponent::VertexAttributes>& attrs =
sorted_increasing->GetAttributeBuffer();
// Verify that the first triangle has the correct z-values for its
// vertices.
EXPECT_EQ(1.0f, attrs[index_buf[0]].position[2]);
EXPECT_EQ(1.0f, attrs[index_buf[1]].position[2]);
EXPECT_EQ(1.0f, attrs[index_buf[2]].position[2]);
// Verify that the second triangle has the correct z-values for its
// vertices.
EXPECT_EQ(2.0f, attrs[index_buf[3]].position[2]);
EXPECT_EQ(2.0f, attrs[index_buf[4]].position[2]);
EXPECT_EQ(2.0f, attrs[index_buf[5]].position[2]);
}
const auto sorted_decreasing =
MeshComponentUtil::SortTrianglesByDistanceToEye(
*original_mesh, Point3f(0.0f, 0.0f, 0.0f),
MeshComponentUtil::SortingOrder::kBackToFront);
{
const std::vector<uint32>& index_buf = sorted_decreasing->GetIndexBuffer();
const std::vector<MeshComponent::VertexAttributes>& attrs =
sorted_decreasing->GetAttributeBuffer();
// Verify that the first triangle has the correct z-values for its
// vertices.
EXPECT_EQ(2.0f, attrs[index_buf[0]].position[2]);
EXPECT_EQ(2.0f, attrs[index_buf[1]].position[2]);
EXPECT_EQ(2.0f, attrs[index_buf[2]].position[2]);
// Verify that the second triangle has the correct z-values for its
// vertices.
EXPECT_EQ(1.0f, attrs[index_buf[3]].position[2]);
EXPECT_EQ(1.0f, attrs[index_buf[4]].position[2]);
EXPECT_EQ(1.0f, attrs[index_buf[5]].position[2]);
}
}
TEST(MeshComponentUtilTest, CountTransparentTexelEdges) {
std::array<std::array<char, 5>, 4> test_alpha_matte = {{
{{0, 0, 1, 0, 0}}, //
{{0, 1, 1, 1, 0}}, //
{{0, 1, 1, 0, 0}}, //
{{0, 1, 1, 0, 1}}, //
}};
int expected_result = 13;
// Generate a texture based on our test_alpha_matte.
ion::gfx::ImagePtr texture =
base::CreateImage(ion::gfx::Image::kRgba8888, {5, 4});
const auto data_container = texture->GetData();
uint8* texture_data = data_container->GetMutableData<uint8>();
std::mt19937 prng;
std::uniform_int_distribution<int> opaque_alpha_dist(1, 255);
for (int y = 0; y < texture->GetHeight(); ++y) {
for (int x = 0; x < texture->GetWidth(); ++x) {
uint8 alpha;
if (test_alpha_matte[y][x] == 1) {
alpha = opaque_alpha_dist(prng);
} else {
alpha = 0;
}
int pixel_index = y * texture->GetWidth() + x;
texture_data[pixel_index * 4 + 3] = alpha;
}
}
const auto mesh = MeshComponent::Create("mesh", texture, {}, {});
int result = MeshComponentUtil::CountTransparentTexelEdges(*mesh);
EXPECT_EQ(expected_result, result);
}
} // namespace
} // namespace mesh
} // namespace seurat
| 40.139013 | 80 | 0.646297 | [
"mesh",
"geometry",
"vector"
] |
d0007d02869edd1e168285af32ac2b6c20999d38 | 6,651 | cc | C++ | go_game/gameboard.cc | sanjnair/projects | 9d7fce9a9d219b7e63a06bb57d16f23e20eb4dc3 | [
"MIT"
] | null | null | null | go_game/gameboard.cc | sanjnair/projects | 9d7fce9a9d219b7e63a06bb57d16f23e20eb4dc3 | [
"MIT"
] | 6 | 2017-09-11T03:36:02.000Z | 2017-09-19T06:56:05.000Z | go_game/gameboard.cc | sanjnair/projects | 9d7fce9a9d219b7e63a06bb57d16f23e20eb4dc3 | [
"MIT"
] | null | null | null | ///
/// Game board class
/// @author - Sanjay Nair
///
#include "gameboard.h"
#include "gameexception.h"
#include <queue>
#include <iostream>
#include <iomanip>
using namespace std;
///
/// define navigation pattern for stones
///
static const vector<pair<int, int>> CELL_NAV_PATTERN = { {0, -1}, {0, 1}, {-1, 0}, {1, 0} };
///
/// Creates game board for the given rows and cols
///
GameBoard::GameBoard(
size_t rows,
size_t cols)
: _isValidBoard(true)
, _rows(rows)
, _cols(cols)
, _lastColor(StoneColor::NoColor)
, _board(rows, vector<StoneColor>(cols, StoneColor::NoColor))
, _visited(rows, vector<bool>(cols, false))
{}
///
/// Returns number of rows in the board
///
size_t GameBoard::getNumRows() const
{
return _board.size();
}
///
/// Returns true if the board is valid
///
bool GameBoard::isValid() const
{
return _isValidBoard;
}
///
/// Returns number of cols in the board
///
size_t GameBoard::getNumCols() const
{
size_t cols = 0;
if (_board.size() > 0) {
cols = _board.at(0).size();
}
return cols;
}
///
/// Returns color of the cell.
/// If invalid cell, throw game exception
///
StoneColor GameBoard::getColor(
int row,
int col) const
{
if (!isValidCell(row, col)) {
string msg("Invalid row/col index specified.");
msg += " row = " + to_string(row);
msg += " col = " + to_string(col);
throw GameException(msg, __FILE__, __LINE__);
}
return _board[row][col];
}
///
/// Returns true if the given row and col indices are valid
///
bool GameBoard::isValidCell(
int row,
int col) const
{
return ((row >= 0) &&
(row < static_cast<int>(_rows)) &&
(col >= 0) &&
(col < static_cast<int>(_cols)));
}
///
/// Moves the stone to the specified cell.
/// Returns true if the move is valid,
/// otherwise, returns false
///
bool GameBoard::moveStone(
int row,
int col,
StoneColor color)
{
/// Do early check
// validate cell
if (!_isValidBoard ||
!isValidCell(row, col) ||
(StoneColor::NoColor != _board[row][col]) ||
(StoneColor::NoColor == color) ||
(_lastColor == color)) {
return false;
}
_board[row][col] = color;
/// TODO: Optimization - no need to find liberty again for already connected neighbors
// Flood fill algorithm (using BFS) on neighbors for connectivity
for (const pair<int, int>& pattern : CELL_NAV_PATTERN) {
int newRow = row + pattern.first;
int newCol = col + pattern.second;
if (isValidCell(newRow, newCol) &&
(_board[newRow][newCol] != StoneColor::NoColor) &&
(_board[newRow][newCol] != color)) {
// If no connected liberty, perform capture operation
if (!hasConnectedLiberty(newRow, newCol, true)) {
performCapture();
}
}
}
// check if we have induced a self capture with this move
if (!hasConnectedLiberty(row, col, false)) {
_board[row][col] = StoneColor::NoColor;
_isValidBoard = false;
}
else {
_lastColor = color;
}
return _isValidBoard;
}
///
/// Performs capture based on the contents of _visitedCells
///
void GameBoard::performCapture() {
for (const Cell& cell : _visitedCells) {
_board[cell.row][cell.col] = StoneColor::NoColor;
}
}
///
/// Returns true if the specified cell has connected liberty.
///
/// For each stone S :
/// a.A *liberty* of S is an empty grid point horizontally or vertically adjacent
/// to S.
/// b.A stone *connected* to S is a stone of like color that is horizontally or
/// vertically adjacent to another stone connected to S.
/// c.S is connected to itself.
/// d.S is *captured* if it is not connected to a stone with a liberty.
///
/// Will use BFS algorithm to get the liberty information
/// If liberty is found is any of the connected cell, this function will return immediately.
///
bool GameBoard::hasConnectedLiberty(
int row,
int col,
bool captureCells)
{
/// clear the _visited and _visitedCells
for (size_t i = 0; i < _visited.size(); ++i) {
fill(_visited[i].begin(), _visited[i].end(), false);
}
_visitedCells.clear();
StoneColor color = _board[row][col];
queue<Cell> searchQueue;
searchQueue.push(Cell(row, col));
_visited[row][col] = true;
if (captureCells) {
_visitedCells.push_back(searchQueue.front());
}
while (!searchQueue.empty()) {
Cell cell = searchQueue.front();
searchQueue.pop();
for (const pair<int, int>& pattern : CELL_NAV_PATTERN) {
int newRow = cell.row + pattern.first;
int newCol = cell.col + pattern.second;
// check if already visisted a valid cell
if (isValidCell(newRow, newCol) && !_visited[newRow][newCol]) {
_visited[newRow][newCol] = true;
// Liberty found!! - return immediately
if (_board[newRow][newCol] == StoneColor::NoColor) {
return true;
}
else if (_board[newRow][newCol] == color) {
Cell newCell(static_cast<size_t>(newRow), static_cast<size_t>(newCol));
searchQueue.push(newCell);
_visited[newRow][newCol] = true;
if (captureCells) {
_visitedCells.push_back(newCell);
}
}
}
}
}
return false;
}
//====== DEBUGGING CODE =======================================================
///
/// Debug function to print Board
///
void GameBoard::printBoard() const
{
static const vector<string> COLOR_STR = { "-", "W", "B" };
cout << endl << endl;
if (_board.empty()) {
cout << "Board EMPTY" << endl;
}
else {
size_t rows = getNumRows();
size_t cols = getNumCols();
size_t maxColStr = to_string(cols).length() + 1;
for (size_t col = 0; col < cols; ++col) {
if (col == 0) {
}
cout << setw(maxColStr) << col;
}
cout << endl;
for (size_t row = 0; row < rows; ++row) {
cout << row;
for (size_t col = 0; col < cols; ++col) {
int colorIdx = static_cast<int>(_board[row][col]);
cout << setw(maxColStr) << COLOR_STR[colorIdx];
}
cout << endl;
}
}
} | 25.679537 | 92 | 0.555405 | [
"vector"
] |
d00557a8de32f3960fdc2bf80c3a27e31fa04749 | 2,587 | cpp | C++ | src/player.cpp | Andlon/aria | 30fcabf9a2f577c6bbaea66ca0b3ead21dba92e1 | [
"MIT"
] | null | null | null | src/player.cpp | Andlon/aria | 30fcabf9a2f577c6bbaea66ca0b3ead21dba92e1 | [
"MIT"
] | 1 | 2015-08-26T15:20:32.000Z | 2015-08-26T15:20:32.000Z | src/player.cpp | Andlon/aria | 30fcabf9a2f577c6bbaea66ca0b3ead21dba92e1 | [
"MIT"
] | null | null | null | #include <aria/player.hpp>
#include <string>
#include <cstddef>
#include <iostream>
namespace asio = boost::asio;
using boost::asio::ip::tcp;
using boost::system::error_code;
namespace aria {
player::player(std::shared_ptr<player_callbacks> callbacks)
: _callbacks(callbacks), _resolver(io_service())
{
}
void player::connect_speaker(const std::string &host, uint16_t port)
{
typedef tcp::resolver::iterator iterator;
tcp::resolver::query query(host, std::to_string(port));
_resolver.async_resolve(query, [this] (const error_code & error,
iterator endpoint_iterator) {
if (!error)
{
auto socket = std::make_shared<tcp::socket>(io_service());
boost::asio::async_connect(*socket, endpoint_iterator,
[this, socket] (const error_code & error,
iterator endpoint)
{
iterator end;
if (!error && endpoint != end)
{
run_on_main_thread([=] {
_sockets.push_back(socket);
_callbacks->connected();
});
}
else
{
run_on_main_thread([this] { _callbacks->connection_failed(); });
}
});
}
else
{
// TODO: error handling when resolution fails
}
});
}
void player::feed_audio(std::vector<char> && data)
{
if (!data.empty())
{
// Create shared pointer to data to ensure that the data lives
// until the async_write completion handler is run
auto shared_data = std::make_shared<std::vector<char>>(std::move(data));
for (auto socket : _sockets)
{
asio::async_write(*socket, asio::buffer(*shared_data),
[shared_data] (const class error_code &error,
std::size_t)
{
if (error)
{
// TODO: Proper error handling
std::cerr << "Error occured when writing to socket." << std::endl;
}
});
}
}
}
void player::before_io_service()
{
// Do nothing for now
}
}
| 31.54878 | 90 | 0.454194 | [
"vector"
] |
d0059d56a7c071f9feae94a40a9fe5a29acd6418 | 32,578 | cpp | C++ | src/base/matrix.cpp | Caprica666/vixen | b71e9415bbfa5f080aee30a831e3b0c8f70fcc7d | [
"BSD-2-Clause"
] | 1 | 2019-02-13T15:39:56.000Z | 2019-02-13T15:39:56.000Z | src/base/matrix.cpp | Caprica666/vixen | b71e9415bbfa5f080aee30a831e3b0c8f70fcc7d | [
"BSD-2-Clause"
] | null | null | null | src/base/matrix.cpp | Caprica666/vixen | b71e9415bbfa5f080aee30a831e3b0c8f70fcc7d | [
"BSD-2-Clause"
] | 2 | 2017-11-09T12:06:41.000Z | 2019-02-13T15:40:02.000Z |
/****
*
* Matrix: 3D transformation matrix class
*
****/
#include "vixen.h"
namespace Vixen
{
Messenger& operator<<(Messenger& d, const Col4& c)
{ return d << c.r << c.g << c.b << c.a; }
Messenger& operator>>(Messenger& d, Col4& c)
{ return d >> c.r >> c.g >> c.b >> c.a; }
Messenger& operator<<(Messenger& d, const Vec2& v)
{ return d << v.x << v.y; }
Messenger& operator>>(Messenger& d, Vec2& v)
{ return d >> v.x >> v.y; }
Messenger& operator<<(Messenger& d, const Vec3& v)
{ return d << v.x << v.y << v.z; }
Messenger& operator>>(Messenger& d, Vec3& v)
{ return d >> v.x >> v.y >> v.z; }
Messenger& operator<<(Messenger& d, const Vec4& v)
{ return d << v.x << v.y << v.z << v.w; }
Messenger& operator>>(Messenger& d, Vec4& v)
{ return d >> v.x >> v.y >> v.z >> v.w; }
VX_IMPLEMENT_CLASSID(Matrix, SharedObj, VX_Matrix);
Matrix* Matrix::s_IdentityMatrix = NULL;
static const TCHAR* opnames[] =
{ TEXT("Identity"), TEXT("SetMatrix"), };
const TCHAR** Matrix::DoNames = opnames;
static void Up_triangle_Inverse_Xform(const float [4][4], float [4][4]);
static void Down_triangle_Inverse_Xform(const float [4][4], float [4][4]);
static void Full_Inverse_Xform3(const float [4][4], float [4][4]);
Matrix::Matrix() : SharedObj()
{
identity = false;
Identity();
}
Matrix::Matrix(const float *foreign_data) : SharedObj()
{
assert( 0 != foreign_data );
identity = false;
memcpy(data, foreign_data, sizeof(data));
SetChanged(true);
}
Matrix::Matrix(const Matrix& rhs) : SharedObj(rhs)
{
memcpy(data, rhs.data, sizeof(data));
identity = rhs.identity;
}
/*!
* @fn Vec4 Matrix::GetRotationAxis() const
*
* Returns the axis and angle of rotation about
* that axis as a vector. The x, y, z components
* of the vector specify the axis and w gives
* the rotation angle in radians.
*
*@see Quat::Quat Matrix::Rotate Matrix::RotationMatrix
*/
Vec4 Matrix::GetRotationAxis() const
{
Vec3 V;
double theta, factor;
// convert from cosine matrix to axis-angle
theta = acos((Get(0, 0) + Get(1, 1) + Get(2, 2) - 1.0f) * 0.5f);
factor = sin(theta);
if ( fabs( theta) < 0.0003)
{ // theta < 1 minute of arc
V.x = 0.0f; V.y = 0.0f; V.z = 0.0f;
}
else
{
factor = 1.0 / (2.0 * factor);
V.x = (float) (factor * (Get(2, 1) - Get(1, 2)));
V.y = (float) (factor * (Get(0, 2) - Get(2, 0)));
V.z = (float) (factor * (Get(1, 0) - Get(0, 1)));
}
return Vec4(V.x, V.y, V.z, float(theta));
}
void Matrix::GetRotation(Vec3* vecs) const
{
vecs[0].Set(Get(0, 0), Get(1, 0), Get(2, 0));
vecs[1].Set(Get(0, 1), Get(1, 1), Get(2, 1));
vecs[2].Set(Get(0, 2), Get(1, 2), Get(2, 2));
}
/*!
* @fn void Matrix::Touch()
*
* Notifies the transform that you have changed it's data.
* In the base class, it sets the SharedObj::CHANGED flag.
* This flag may be checked by clients of this Matrix
* to determine it has been updated. Model objects
* use this capability to determine their internal
* transforms have been changed during scene graph display.
*
*/
void Matrix::Touch()
{ SetChanged(true); }
/****
*
* class Matrix override for SharedObj::Print
* Prints a Matrix in ASCII format on standard output
*
****/
DebugOut& Matrix::Print(DebugOut& dbg, int opts) const
{
if ((opts == 0) || (opts & (PRINT_Data | PRINT_Attributes)))
{
SharedObj::Print(dbg, opts & ~PRINT_Trailer);
for (int i = 0; i < 4; ++i)
{
dbg << "\t";
for (int j = 0; j < 4; ++j)
dbg << Get(i, j) << "\t";
endl(dbg);
}
SharedObj::Print(dbg, opts & PRINT_Trailer);
}
else SharedObj::Print(dbg, opts);
return dbg;
}
/*!
* @fn void Matrix::Identity()
*
* Replaces this matrix with the identity matrix.
* The previous contents of the matrix are lost.
*
* @see Matrix::SetMatrix Matrix::Matrix Matrix::Identity
*/
void Matrix::Identity()
{
if (identity)
return;
else
identity = true;
SetChanged(true);
#if 1
data[0][1] = 0.0f;
data[0][2] = 0.0f;
data[0][3] = 0.0f;
data[3][3] = 1.0f;
data[1][0] = 0.0f;
data[1][2] = 0.0f;
data[1][3] = 0.0f;
data[3][3] = 1.0f;
data[2][0] = 0.0f;
data[2][1] = 0.0f;
data[2][2] = 1.0f;
data[3][3] = 1.0f;
data[2][3] = 0.0f;
data[1][1] = 1.0f;
data[3][0] = 0.0f;
data[3][1] = 0.0f;
data[3][2] = 0.0f;
data[0][0] = 1.0f;
data[3][3] = 1.0f;
#else
data[0][0] = 1.0f;
data[0][1] = 0.0f;
data[0][2] = 0.0f;
data[0][3] = 0.0f;
data[1][0] = 0.0f;
data[1][1] = 1.0f;
data[1][2] = 0.0f;
data[1][3] = 0.0f;
data[2][0] = 0.0f;
data[2][1] = 0.0f;
data[2][2] = 1.0f;
data[2][3] = 0.0f;
data[3][0] = 0.0f;
data[3][1] = 0.0f;
data[3][2] = 0.0f;
data[3][3] = 1.0f;
#endif
}
/*!
* @fn void Matrix::Zero()
*
* Sets all the matrix elements to zero.
* This is different than the identity matrix
* which puts 1s along the diagonal.
*
* @see Matrix::Identity Matrix::SetMatrix
*/
void Matrix::Zero()
{
memset(data, 0, sizeof(data) );
identity = false;
SetChanged(true);
}
/*!
* @fn void Matrix::SetMatrix(const float* src)
* @param data Array of 16 floating values that defines a 4x4 matrix.
* If NULL, the matrix is initialized as identity.
*
* Updates the 4x4 matrix data area of the matrix.
*
* @see Matrix::Identity Matrix::Matrix
*/
void Matrix::SetMatrix(const float* src)
{
VX_STREAM_BEGIN(s)
if (src == NULL)
*s << OP(VX_Matrix, MATRIX_Identity) << this;
else
{
*s << OP(VX_Matrix, MATRIX_SetMatrix) << this;
s->Output((float*) src, 16);
}
VX_STREAM_END( )
SetChanged(true);
identity = false;
memcpy(data, src, sizeof(data));
}
void Matrix::XAngleMatrix(float angle)
{
float cost = cosf(angle);
float sint = sinf(angle);
data[0][0] = 1.0f;
data[0][1] = 0.0f;
data[0][2] = 0.0f;
data[1][0] = 0.0f;
data[1][1] = cost;
data[1][2] = -sint;
data[2][0] = 0.0f;
data[2][1] = sint;
data[2][2] = cost;
identity = false;
SetChanged(true);
}
void Matrix::YAngleMatrix(float angle)
{
float cost = cosf(angle);
float sint = sinf(angle);
data[0][0] = cost;
data[0][1] = 0.0f;
data[0][2] = sint;
data[1][0] = 0.0f;
data[1][1] = 1.0f;
data[1][2] = 0.0f;
data[2][0] = -sint;
data[2][1] = 0.0f;
data[2][2] = cost;
identity = false;
SetChanged(true);
}
void Matrix::ZAngleMatrix(float angle)
{
float cost = cosf(angle);
float sint = sinf(angle);
data[0][0] = cost;
data[0][1] = -sint;
data[0][2] = 0.0f;
data[1][0] = sint;
data[1][1] = cost;
data[1][2] = 0.0f;
data[2][0] = 0.0f;
data[2][1] = 0.0f;
data[2][2] = 1.0f;
identity = false;
SetChanged(true);
}
/*!
* @fn void Matrix::RotationMatrix(const Vec3& axis, float angle)
* @param axis A unit vector in the direction of the axis to rotate about.
* The rotation axis is assumed to go through the origin.
* @param angle Amount to rotate by (in radians)
*
* Replaces this matrix with a rotation matrix that rotates
* \b angle radians about the specified axis
*
* @see Matrix::Rotate Model::Rotate Model::Turn
*/
void Matrix::RotationMatrix(const Vec3& rotaxis, float angle)
{
float cost = cosf(angle);
float sint = sinf(angle);
identity = false;
SetChanged(true);
data[0][3] = 0.0f;
data[1][3] = 0.0f;
data[2][3] = 0.0f;
data[3][3] = 1.0f;
data[3][0] = 0.0f;
data[3][1] = 0.0f;
data[3][2] = 0.0f;
if (rotaxis == Vec3(1, 0, 0))
XAngleMatrix(angle);
else if (rotaxis == Vec3(0, 1, 0))
YAngleMatrix(angle);
else if (rotaxis == Vec3(0, 0, 1))
ZAngleMatrix(angle);
else
{
Vec3 axis(rotaxis);
axis.Normalize();
float mcos = 1.0f - cost;
float x2 = axis.x * axis.x;
float y2 = axis.y * axis.y;
float z2 = axis.z * axis.z;
float xym = axis.x * axis.y * mcos;
float xzm = axis.x * axis.z * mcos;
float yzm = axis.y * axis.z * mcos;
float asin = axis.x * sint;
float bsin = axis.y * sint;
float csin = axis.z * sint;
data[0][0] = x2 * mcos + cost;
data[0][1] = xym - csin;
data[0][2] = xzm + bsin;
data[1][0] = xym + csin;
data[1][1] = y2 * mcos + cost;
data[1][2] = yzm - asin;
data[2][0] = xzm - bsin;
data[2][1] = yzm + asin;
data[2][2] = z2 * mcos + cost;
}
}
/*!
* @fn void Matrix::RotationMatrix(const Quat& q)
* @param q Quaternion specifying rotation
*
* Replaces this matrix with a rotation matrix constructed
* from the input quaternion.
*
* @see Quat Matrix::Rotate Model::Rotate Model::Turn
*/
void Matrix::RotationMatrix(const Quat& q)
{
Set(q);
}
/*!
* @fn void Matrix::RotationMatrix(const VXVecs* vecs)
* @param vecs array of 3 linearly independent vectors
*
* Replaces this matrix with a rotation matrix constructed
* from the input vectors
*
* @see Quat Matrix::GetRotation Matrix::Rotate Model::Rotate Model::Turn
*/
void Matrix::RotationMatrix(const Vec3* vecs)
{
for (int c = 0; c < 3; c++)
{
Set(0, c, vecs[c].x);
Set(1, c, vecs[c].y);
Set(2, c, vecs[c].z);
}
}
/*!
* @fn void Matrix::Rotate(const Vec3& axis, float angle)
* @param axis A unit vector giving the direction
* of the axis to rotate about. The rotation axis is
* assumed to go through the origin.
* @param angle Amount to rotate by (in radians)
* @param quat Quaternion specifying rotation axis and angle
*
* Pre-multiplies this matrix with a rotation matrix about given axis.
*
* @see Matrix::Translate Matrix::Scale Model::Rotate Model::Turn
*/
void Matrix::Rotate(const Vec3& axis, float angle)
{
if (angle == 0.0)
return;
Matrix tmp;
tmp.RotationMatrix(axis, angle);
PreMul(tmp);
}
/*!
* @fn void Matrix::Rotate(const Quat& q)
* @param quat Quaternion specifying rotation axis and angle
*
* Pre-multiplies this matrix with a rotation matrix constructed
* from the input quaternion.
*
* @see Quat Matrix::Translate Matrix::Scale Model::Rotate Model::Turn
*/
void Matrix::Rotate(const Quat& q)
{
Matrix tmp;
tmp.RotationMatrix(q);
PreMul(tmp);
}
/*!
* @fn void Matrix::TranslationMatrix(const Vec3 &v)
* @param v translation vector
*
* Replaces this matrix with a translation matrix
* @code
* | 1 0 0 v.x |
* | 0 1 0 v.y |
* | 0 0 1 v.z |
* | 0 0 0 1 |
* @endcode
*
*
* @see Matrix::Translate Model::Translate Model::Move
*/
void Matrix::TranslationMatrix(const Vec3 &v)
{
//jb - try to save some time
if (identity)
{
data[0][3] = v.x;
data[1][3] = v.y;
data[2][3] = v.z;
}
else
{
data[0][0] = 1.0f;
data[0][1] = 0.0f;
data[0][2] = 0.0f;
data[0][3] = v.x;
data[1][0] = 0.0f;
data[1][1] = 1.0f;
data[1][2] = 0.0f;
data[1][3] = v.y;
data[2][0] = 0.0f;
data[2][1] = 0.0f;
data[2][2] = 1.0f;
data[2][3] = v.z;
data[3][0] = 0.0f;
data[3][1] = 0.0f;
data[3][2] = 0.0f;
data[3][3] = 1.0f;
}
identity = false;
SetChanged(true);
}
/*!
* @fn void Matrix::Translate(float x, float y, float z)
* @param x amount to translate in X direction
* @param y amount to translate in Y direction
* @param z amount to translate in Z direction
*
* Pre-multiplies this matrix with a translation matrix
* @code
* | 1 0 0 x |
* | 0 1 0 y |
* | 0 0 1 z |
* | 0 0 0 1 |
* @endcode
*
* @see Matrix::Translate Model::Translate Model::Move
*/
void Matrix::Translate(float x, float y, float z)
{
//jb - took out one layer of function calls
Matrix tmp;
tmp.TranslationMatrix(Vec3(x, y, z));
PreMul(tmp);
}
/*!
* @fn void Matrix::Translate(const Vec3 &v)
* @param v translation vector
*
* Pre-multiplies this matrix with a translation matrix
* @code
* | 1 0 0 v.x |
* | 0 1 0 v.y |
* | 0 0 1 v.z |
* | 0 0 0 1 |
* @endcode
*
* @see Matrix::Translate Model::Translate Model::Move
*/
void Matrix::Translate(const Vec3& p)
{
Matrix tmp;
tmp.TranslationMatrix(p);
PreMul(tmp);
}
/*!
* @fn void Matrix::ScaleMatrix(const Vec3& v)
* @param v scaling vector
*
* Replaces this matrix by a scaling matrix.
* @code
* | v.x 0 0 0 |
* | 0 v.y 0 0 |
* | 0 0 v.z 0 |
* | 0 0 0 1 |
* @endcode
*
* @see Matrix::Scale Model::Scale Model::Size
*/
void Matrix::ScaleMatrix(const Vec3 &s)
{
if (identity)
{
data[0][0] = s.x;
data[1][1] = s.y;
data[2][2] = s.z;
}
else
{
data[0][0] = s.x;
data[0][1] = 0.0f;
data[0][2] = 0.0f;
data[0][3] = 0.0f;
data[1][0] = 0.0f;
data[1][1] = s.y;
data[1][2] = 0.0f;
data[1][3] = 0.0f;
data[2][0] = 0.0f;
data[2][1] = 0.0f;
data[2][2] = s.z;
data[2][3] = 0.0f;
data[3][0] = 0.0f;
data[3][1] = 0.0f;
data[3][2] = 0.0f;
data[3][3] = 1.0f;
}
identity = false;
SetChanged(true);
}
/*!
* @fn void Matrix::Scale(float x, float y, float z)
* @param x amount to scale in X direction
* @param y amount to scale in Y direction
* @param z amount to scale in Z direction
*
* Pre multiplies this matrix by a scaling matrix.
* @code
* this = | x 0 0 0 | * this
* | 0 y 0 0 |
* | 0 0 z 0 |
* | 0 0 0 1 |
* @endcode
*
* @see Matrix::Rotate Matrix::Translate Model::Scale Model::Size
*/
void Matrix::Scale(float x, float y, float z)
{
//jb - removing function calls
//Scale(Vec3(x, y, z));
Matrix tmp;
tmp.ScaleMatrix(Vec3(x, y, z));
PreMul(tmp);
}
/*!
* @fn void Matrix::Scale(const Vec3& v)
* @param v scaling vector
*
* Pre-multiplies this matrix by a scaling matrix.
* @code
* this = | v.x 0 0 0 | * this
* | 0 v.y 0 0 |
* | 0 0 v.z 0 |
* | 0 0 0 1 |
* @endcode
*
* @see Matrix::Rotate Matrix::Translate Model::Scale Model::Size
*/
void Matrix::Scale(const Vec3& p)
{
Matrix tmp;
tmp.ScaleMatrix(p);
PreMul(tmp);
}
/*!
* @fn void Matrix::LookAt(const Vec3& v, float twist)
* @param lookat Point to look at. The vector from the origin to
* this point defines the line of sight.
* @param twist Amount to twist around the Z axis.
*
* Replaces this matrix with one which orients to
* to look at a specific point.
*
* @see Model::LookAt Matrix::Rotate
*/
void Matrix::LookAt(const Vec3& v, float twist)
{
float l2, l3, sintheta, sinphi, costheta, cosphi;
Matrix tmp;
l2 = sqrtf((float) ((v.x * v.x) + (v.z * v.z)));
l3 = sqrtf((float) ((v.x * v.x) + (v.y * v.y) + (v.z * v.z)));
Identity();
if (l2 != 0.0)
{
sintheta = (-v.x) / l2;
costheta = (-v.z) / l2;
/*
* Rotate about Y by theta
*/
tmp.Identity();
tmp.Set(0, 0, costheta);
tmp.Set(2, 2, costheta);
tmp.Set(2, 0, -sintheta);
tmp.Set(0, 2, sintheta);
PostMul(tmp);
}
if (l3 != 0.0)
{
sinphi = v.y / l3;
cosphi = l2 / l3;
/*
* Rotate about X by phi
*/
tmp.Identity();
tmp.Set(1, 1, cosphi);
tmp.Set(2, 2, cosphi);
tmp.Set(2, 1, sinphi);
tmp.Set(1, 2, -sinphi);
PostMul(tmp);
}
tmp.RotationMatrix(Vec3(0, 0, 1), twist);
PostMul(tmp);
}
/*!
* @fn Matrix& Matrix::operator+=(const Matrix& m)
* @param src Matrix to add to this matrix
*
* Adds the source matrix to this matrix by adding
* corresponding elements.
*
* @see Matrix::operator-= Matrix::Multiply
*/
Matrix& Matrix::operator+=(const Matrix& m)
{
const float* src = m.GetMatrix();
float* dst = (float*) data;
for (int i=0; i < 16; i++)
dst[i] += src[i];
identity = false;
SetChanged(true);
return *this;
}
/*!
* @fn Matrix& Matrix::operator-=(const Matrix& m)
* @param src Matrix to subtract from this matrix
*
* Subtracts the source matrix to this matrix by subtracting
* corresponding elements.
*
* @see Matrix::operator+= Matrix::Multiply
*/
Matrix& Matrix::operator-=(const Matrix& m)
{
const float* src = m.GetMatrix();
float* dst = (float*) data;
for (int i=0; i < 16; i++)
dst[i] -= src[i];
identity = false;
SetChanged(true);
return *this;
}
/*!
* @fn void Matrix::PreMul(const Matrix& src)
* @param src input multiplicand
*
* Multiplies the input matrix by this matrix and stores the result
* in this matrix. Performs a full 4x4 matrix multiplication.
* <B>this = src * this</B>
*
* @see Matrix::Multiply Matrix::PostMul Matrix::operator*= Matrix::operator+= Matrix::operator-=
*/
void Matrix::PreMul(const Matrix& src)
{
Matrix tmp(*this);
Multiply(src, tmp);
}
/*!
* @fn void Matrix::PostMul(const Matrix& src)
* @param src input multiplicand
*
* Multiplies this matrix by the input matrix and stores the result
* in this matrix. Performs a full 4x4 matrix multiplication.
* <B>this = this * src</B>
*
* @see Matrix::operator*= Matrix::Multiply Matrix::PreMul Matrix::operator+= Matrix::operator-=
*/
void Matrix::PostMul(const Matrix& src)
{
Matrix tmp(*this);
Multiply(tmp, src);
}
/*!
* @fn Matrix& Matrix::operator*=(const Matrix& src)
* @param src input multiplicand
*
* Multiplies this matrix by the input matrix and stores the result
* in this matrix. Performs a full 4x4 matrix multiplication.
* <B>this = this * src</B>
*
* @see Matrix::Multiply Matrix::PreMul Matrix::operator+= Matrix::operator-=
*/
Matrix& Matrix::operator*=(const Matrix& src)
{ PostMul(src); return *this; }
/*!
* @fn void Matrix::Multiply(const Matrix &mtxA, const Matrix &mtxB)
* @param mtxA first multiplicand
* @param mtxB second multiplicand
*
* Multiplies the input matrices and stores the result in this matrix.
* Performs a full 4x4 matrix multiplication.
* <B>this = mtxA * mtxB</B>
*
* We interpret matrices to be in the same row/column order as C arrays.
* To get element[i][j] of the destination, we multiply the ith row of A
* by the jth column of B.
* This routine does not work if two or more of the matrices are
* the same. A call like Matrix::Mul(a, a, b) will compute the wrong result.
*
* @see Matrix::PreMul Matrix::PostMul Matrix::operator*=
*/
void Matrix::Multiply(const Matrix &inA, const Matrix &inB)
{
const Matrix& a = (const Matrix&) inA;
const Matrix& b = (const Matrix&) inB;
VX_ASSERT(a.IsClass(VX_Matrix));
VX_ASSERT(b.IsClass(VX_Matrix));
if (a.identity && b.identity)
{
Identity();
return;
}
identity = false;
if (a.identity)
{
Copy(b);
return;
}
if (b.identity)
{
Copy(a);
return;
}
SetChanged(true);
data[0][0]=a.data[0][0]*b.data[0][0]+a.data[0][1]*b.data[1][0]+a.data[0][2]*b.data[2][0]+a.data[0][3]*b.data[3][0];
data[1][0]=a.data[1][0]*b.data[0][0]+a.data[1][1]*b.data[1][0]+a.data[1][2]*b.data[2][0]+a.data[1][3]*b.data[3][0];
data[2][0]=a.data[2][0]*b.data[0][0]+a.data[2][1]*b.data[1][0]+a.data[2][2]*b.data[2][0]+a.data[2][3]*b.data[3][0];
data[3][0]=a.data[3][0]*b.data[0][0]+a.data[3][1]*b.data[1][0]+a.data[3][2]*b.data[2][0]+a.data[3][3]*b.data[3][0];
data[0][1]=a.data[0][0]*b.data[0][1]+a.data[0][1]*b.data[1][1]+a.data[0][2]*b.data[2][1]+a.data[0][3]*b.data[3][1];
data[1][1]=a.data[1][0]*b.data[0][1]+a.data[1][1]*b.data[1][1]+a.data[1][2]*b.data[2][1]+a.data[1][3]*b.data[3][1];
data[2][1]=a.data[2][0]*b.data[0][1]+a.data[2][1]*b.data[1][1]+a.data[2][2]*b.data[2][1]+a.data[2][3]*b.data[3][1];
data[3][1]=a.data[3][0]*b.data[0][1]+a.data[3][1]*b.data[1][1]+a.data[3][2]*b.data[2][1]+a.data[3][3]*b.data[3][1];
data[0][2]=a.data[0][0]*b.data[0][2]+a.data[0][1]*b.data[1][2]+a.data[0][2]*b.data[2][2]+a.data[0][3]*b.data[3][2];
data[1][2]=a.data[1][0]*b.data[0][2]+a.data[1][1]*b.data[1][2]+a.data[1][2]*b.data[2][2]+a.data[1][3]*b.data[3][2];
data[2][2]=a.data[2][0]*b.data[0][2]+a.data[2][1]*b.data[1][2]+a.data[2][2]*b.data[2][2]+a.data[2][3]*b.data[3][2];
data[3][2]=a.data[3][0]*b.data[0][2]+a.data[3][1]*b.data[1][2]+a.data[3][2]*b.data[2][2]+a.data[3][3]*b.data[3][2];
data[0][3]=a.data[0][0]*b.data[0][3]+a.data[0][1]*b.data[1][3]+a.data[0][2]*b.data[2][3]+a.data[0][3]*b.data[3][3];
data[1][3]=a.data[1][0]*b.data[0][3]+a.data[1][1]*b.data[1][3]+a.data[1][2]*b.data[2][3]+a.data[1][3]*b.data[3][3];
data[2][3]=a.data[2][0]*b.data[0][3]+a.data[2][1]*b.data[1][3]+a.data[2][2]*b.data[2][3]+a.data[2][3]*b.data[3][3];
data[3][3]=a.data[3][0]*b.data[0][3]+a.data[3][1]*b.data[1][3]+a.data[3][2]*b.data[2][3]+a.data[3][3]*b.data[3][3];
}
void Matrix::Transform(const Vec4 &tmp, Vec4 &dst) const
{
dst.x = Dot4(tmp, data[0]);
dst.y = Dot4(tmp, data[1]);
dst.z = Dot4(tmp, data[2]);
dst.w = Dot4(tmp, data[3]);
}
void Matrix::Transform(const Vec3 &tmp, Vec4 &dst) const
{
dst.x = Dot3(tmp, data[0]) + data[0][3];
dst.y = Dot3(tmp, data[1]) + data[1][3];
dst.z = Dot3(tmp, data[2]) + data[2][3];
dst.w = Dot3(tmp, data[3]) + data[3][3];
}
void Matrix::Transform(const Sphere& src, Sphere& dst) const
{
Transform(src.Center, dst.Center);
double rx, tmp;
if (identity)
dst.Radius = src.Radius;
else
{
rx = fabs(data[0][0]);
tmp = fabs(data[0][1]);
if (tmp > rx) rx = tmp;
tmp = fabs(data[0][2]);
if (tmp > rx) rx = tmp;
tmp = fabs(data[1][0]);
if (tmp > rx) rx = tmp;
tmp = fabs(data[1][1]);
if (tmp > rx) rx = tmp;
tmp = fabs(data[1][2]);
if (tmp > rx) rx = tmp;
tmp = fabs(data[2][0]);
if (tmp > rx) rx = tmp;
tmp = fabs(data[2][1]);
if (tmp > rx) rx = tmp;
tmp = fabs(data[2][2]);
if (tmp > rx) rx = tmp;
dst.Radius = src.Radius * (float) rx;
}
}
/*!
* @fn void Matrix::Transpose()
*
* Transposes the matrix by exchanging M[i][j] and M[j][i]
* for i,j = 1 to 4 (all 16 elements about the diagonal).
*
* @see Matrix::Invert
*/
void Matrix::Transpose()
{
float val;
val = data[0][1];
data[0][1] = data[1][0];
data[1][0] = val;
val = data[0][2];
data[0][2] = data[2][0];
data[2][0] = val;
val = data[0][3];
data[0][3] = data[3][0];
data[3][0] = val;
val = data[1][2];
data[1][2] = data[2][1];
data[2][1] = val;
val = data[1][3];
data[1][3] = data[3][1];
data[3][1] = val;
val = data[2][3];
data[2][3] = data[3][2];
data[3][2] = val;
SetChanged(true);
}
/*!
* @fn void Matrix::Invert(const Matrix& src)
* @param src Source matrix to invert. It's inverse
* replaces the destination matrix.
*
* Replaces this matrix with the inverse of the source matrix.
* Currently this function does not work correctly if the source
* and destination matrices are the same (will not compute inverse
* in place). It also does not tell you if the matrix is singular
* (does not have a valid inverse).
*
* @see Matrix::Transpose
*/
void Matrix::Invert(const Matrix& src)
{
if (src.identity)
{
Identity();
return;
}
identity = false;
SetChanged(true);
if ((src.data[0][3] == 0) && (src.data[1][3] == 0) && (src.data[2][3] == 0))
{
Down_triangle_Inverse_Xform(src.data, data);
return;
}
else if ((src.data[3][0] == 0) && (src.data[3][1] == 0) && (src.data[3][2] == 0))
{
Up_triangle_Inverse_Xform(src.data, data);
return;
}
else
{
Full_Inverse_Xform3(src.data, data);
return;
}
}
/*!
* @fn void Matrix::Invert()
*
* Replaces this matrix with its inverse.
*
* @see Matrix::Transpose
*/
void Matrix::Invert()
{
Matrix tmp(*this);
Invert(tmp);
}
Matrix &Matrix::operator=(const Matrix &src)
{
Copy(src);
return *this;
}
/***
*
* class Matrix override for SharedObj::Copy
*
***/
bool Matrix::Copy(const SharedObj* src)
{
const Matrix* t = (const Matrix*) src;
ObjectLock dlock(this);
ObjectLock slock(src);
VX_ASSERT(t->IsClass(VX_Matrix));
Copy(*t);
return SharedObj::Copy(src);
}
void Matrix::Copy(const Matrix &src)
{
const Matrix& a = (const Matrix&) src;
if (identity == a.identity && identity)
return;
identity = a.identity;
SetChanged(true);
data[0][0]=a.data[0][0]; data[0][1]=a.data[0][1]; data[0][2]=a.data[0][2]; data[0][3]=a.data[0][3];
data[1][0]=a.data[1][0]; data[1][1]=a.data[1][1]; data[1][2]=a.data[1][2]; data[1][3]=a.data[1][3];
data[2][0]=a.data[2][0]; data[2][1]=a.data[2][1]; data[2][2]=a.data[2][2]; data[2][3]=a.data[2][3];
data[3][0]=a.data[3][0]; data[3][1]=a.data[3][1]; data[3][2]=a.data[3][2]; data[3][3]=a.data[3][3];
}
/***
*
* class Matrix override for SharedObj::Do
* TRANS_Identity
* TRANS_SetData gfloat[4][4]
*
****/
bool Matrix::Do(Messenger& s, int op)
{
switch (op)
{
case MATRIX_Identity:
Identity();
break;
case MATRIX_SetMatrix:
float mtx[16];
s.Input((float*) mtx, 16);
SetMatrix(mtx);
break;
default:
return SharedObj::Do(s, op);
}
#ifdef _DEBUG
if (s.Debug)
endl(vixen_debug << ClassName() << "::"
<< Matrix::DoNames[op - MATRIX_Identity]
<< " " << this);
#endif
return true;
}
/****
*
* class Matrix override for SharedObj::Save
*
****/
int Matrix::Save(Messenger& s, int opts) const
{
int32 h = SharedObj::Save(s, opts);
if (h > 0)
{
s << OP(VX_Matrix, MATRIX_SetMatrix) << h;
s.Output(GetMatrix(), 16);
}
return h;
}
static void Full_Inverse_Xform3(const float b[4][4], float a[4][4])
{
long indxc[4], indxr[4], ipiv[4];
long i, icol = 0, irow = 0, j, ir, ic;
float big, dum, pivinv, temp, bb;
ipiv[0] = -1;
ipiv[1] = -1;
ipiv[2] = -1;
ipiv[3] = -1;
a[0][0] = b[0][0];
a[1][0] = b[1][0];
a[2][0] = b[2][0];
a[3][0] = b[3][0];
a[0][1] = b[0][1];
a[1][1] = b[1][1];
a[2][1] = b[2][1];
a[3][1] = b[3][1];
a[0][2] = b[0][2];
a[1][2] = b[1][2];
a[2][2] = b[2][2];
a[3][2] = b[3][2];
a[0][3] = b[0][3];
a[1][3] = b[1][3];
a[2][3] = b[2][3];
a[3][3] = b[3][3];
for (i = 0; i < 4; i++)
{
big = 0.0f;
for (j = 0; j < 4; j++)
{
if (ipiv[j] != 0)
{
if (ipiv[0] == -1)
{
if ((bb = (float) fabs(a[j][0])) > big)
{
big = bb;
irow = j;
icol = 0;
}
}
else if (ipiv[1] > 0)
{
return;
}
if (ipiv[2] == -1)
{
if ((bb = (float) fabs((float) a[j][2])) > big)
{
big = bb;
irow = j;
icol = 2;
}
}
else if (ipiv[2] > 0)
{
return;
}
if (ipiv[3] == -1)
{
if ((bb = (float) fabs((float) a[j][3])) > big)
{
big = bb;
irow = j;
icol = 3;
}
}
else if (ipiv[3] > 0)
{
return;
}
}
}
++(ipiv[icol]);
if (irow != icol)
{
temp = a[irow][0];
a[irow][0] = a[icol][0];
a[icol][0] = temp;
temp = a[irow][1];
a[irow][1] = a[icol][1];
a[icol][1] = temp;
temp = a[irow][2];
a[irow][2] = a[icol][2];
a[icol][2] = temp;
temp = a[irow][3];
a[irow][3] = a[icol][3];
a[icol][3] = temp;
}
indxr[i] = irow;
indxc[i] = icol;
if (a[icol][icol] == 0.0)
{
return;
}
pivinv = 1.0f / a[icol][icol];
a[icol][icol] = 1.0f;
a[icol][0] *= pivinv;
a[icol][1] *= pivinv;
a[icol][2] *= pivinv;
a[icol][3] *= pivinv;
if (icol != 0)
{
dum = a[0][icol];
a[0][icol] = 0.0f;
a[0][0] -= a[icol][0] * dum;
a[0][1] -= a[icol][1] * dum;
a[0][2] -= a[icol][2] * dum;
a[0][3] -= a[icol][3] * dum;
}
if (icol != 1)
{
dum = a[1][icol];
a[1][icol] = 0.0f;
a[1][0] -= a[icol][0] * dum;
a[1][1] -= a[icol][1] * dum;
a[1][2] -= a[icol][2] * dum;
a[1][3] -= a[icol][3] * dum;
}
if (icol != 2)
{
dum = a[2][icol];
a[2][icol] = 0.0f;
a[2][0] -= a[icol][0] * dum;
a[2][1] -= a[icol][1] * dum;
a[2][2] -= a[icol][2] * dum;
a[2][3] -= a[icol][3] * dum;
}
if (icol != 3)
{
dum = a[3][icol];
a[3][icol] = 0.0f;
a[3][0] -= a[icol][0] * dum;
a[3][1] -= a[icol][1] * dum;
a[3][2] -= a[icol][2] * dum;
a[3][3] -= a[icol][3] * dum;
}
}
if (indxr[3] != indxc[3])
{
ir = indxr[3];
ic = indxc[3];
temp = a[0][ir];
a[0][ir] = a[0][ic];
a[0][ic] = temp;
temp = a[1][ir];
a[1][ir] = a[1][ic];
a[1][ic] = temp;
temp = a[2][ir];
a[2][ir] = a[2][ic];
a[2][ic] = temp;
temp = a[3][ir];
a[3][ir] = a[3][ic];
a[3][ic] = temp;
}
if (indxr[2] != indxc[2])
{
ir = indxr[2];
ic = indxc[2];
temp = a[0][ir];
a[0][ir] = a[0][ic];
a[0][ic] = temp;
temp = a[1][ir];
a[1][ir] = a[1][ic];
a[1][ic] = temp;
temp = a[2][ir];
a[2][ir] = a[2][ic];
a[2][ic] = temp;
temp = a[3][ir];
a[3][ir] = a[3][ic];
a[3][ic] = temp;
}
if (indxr[1] != indxc[1])
{
ir = indxr[1];
ic = indxc[1];
temp = a[0][ir];
a[0][ir] = a[0][ic];
a[0][ic] = temp;
temp = a[1][ir];
a[1][ir] = a[1][ic];
a[1][ic] = temp;
temp = a[2][ir];
a[2][ir] = a[2][ic];
a[2][ic] = temp;
temp = a[3][ir];
a[3][ir] = a[3][ic];
a[3][ic] = temp;
}
if (indxr[0] != indxc[0])
{
ir = indxr[0];
ic = indxc[0];
temp = a[0][ir];
a[0][ir] = a[0][ic];
a[0][ic] = temp;
temp = a[1][ir];
a[1][ir] = a[1][ic];
a[1][ic] = temp;
temp = a[2][ir];
a[2][ir] = a[2][ic];
a[2][ic] = temp;
temp = a[3][ir];
a[3][ir] = a[3][ic];
a[3][ic] = temp;
}
}
static float det3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
{
return (float) (a1 * (b2 * c3 - b3 * c2) - b1 * (a2 * c3 - a3 * c2) + c1 * (a2 * b3 - a3 * b2));
}
static void Down_triangle_Inverse_Xform(const float src[4][4], float dst[4][4])
{
float det1, o33;
float a1, a2, a3, b1, b2, b3, c1, c2, c3;
a1 = src[0][0];
b1 = src[0][1];
c1 = src[0][2];
a2 = src[1][0];
b2 = src[1][1];
c2 = src[1][2];
a3 = src[2][0];
b3 = src[2][1];
c3 = src[2][2];
det1 = det3x3(a1, a2, a3, b1, b2, b3, c1, c2, c3);
if (fabs(det1) < VX_SMALL_NUMBER) {
return;
} else {
det1 = 1.0f / det1;
o33 = 1.0f / src[3][3];
dst[0][0] = (b2 * c3 - c2 * b3) * det1;
dst[1][0] = -(a2 * c3 - c2 * a3) * det1;
dst[2][0] = (a2 * b3 - b2 * a3) * det1;
dst[0][1] = -(b1 * c3 - c1 * b3) * det1;
dst[1][1] = (a1 * c3 - c1 * a3) * det1;
dst[2][1] = -(a1 * b3 - b1 * a3) * det1;
dst[0][2] = (b1 * c2 - c1 * b2) * det1;
dst[1][2] = -(a1 * c2 - c1 * a2) * det1;
dst[2][2] = (a1 * b2 - b1 * a2) * det1;
dst[3][0] = -(src[3][0] * dst[0][0] + src[3][1] * dst[1][0] + src[3][2] * dst[2][0]) * o33;
dst[3][1] = -(src[3][0] * dst[0][1] + src[3][1] * dst[1][1] + src[3][2] * dst[2][1]) * o33;
dst[3][2] = -(src[3][0] * dst[0][2] + src[3][1] * dst[1][2] + src[3][2] * dst[2][2]) * o33;
dst[0][3] = 0.0f;
dst[1][3] = 0.0f;
dst[2][3] = 0.0f;
dst[3][3] = o33;
}
}
static void Up_triangle_Inverse_Xform(const float src[4][4], float dst[4][4])
{
float det1, o33;
float a1, a2, a3, b1, b2, b3, c1, c2, c3;
a1 = src[0][0];
b1 = src[0][1];
c1 = src[0][2];
a2 = src[1][0];
b2 = src[1][1];
c2 = src[1][2];
a3 = src[2][0];
b3 = src[2][1];
c3 = src[2][2];
det1 = det3x3(a1, a2, a3, b1, b2, b3, c1, c2, c3);
if (fabs(det1) < VX_SMALL_NUMBER) {
return;
} else {
det1 = (float) (1.0f / det1);
o33 = 1.0f / src[3][3];
dst[0][0] = (b2 * c3 - c2 * b3) * det1;
dst[1][0] = -(a2 * c3 - c2 * a3) * det1;
dst[2][0] = (a2 * b3 - b2 * a3) * det1;
dst[0][1] = -(b1 * c3 - c1 * b3) * det1;
dst[1][1] = (a1 * c3 - c1 * a3) * det1;
dst[2][1] = -(a1 * b3 - b1 * a3) * det1;
dst[0][2] = (b1 * c2 - c1 * b2) * det1;
dst[1][2] = -(a1 * c2 - c1 * a2) * det1;
dst[2][2] = (a1 * b2 - b1 * a2) * det1;
dst[0][3] = -(src[0][3] * dst[0][0] + src[1][3] * dst[0][1] + src[2][3] * dst[0][2]) * o33;
dst[1][3] = -(src[0][3] * dst[1][0] + src[1][3] * dst[1][1] + src[2][3] * dst[1][2]) * o33;
dst[2][3] = -(src[0][3] * dst[2][0] + src[1][3] * dst[2][1] + src[2][3] * dst[2][2]) * o33;
dst[3][0] = 0.0f;
dst[3][1] = 0.0f;
dst[3][2] = 0.0f;
dst[3][3] = o33;
}
}
} // end Vixen | 24.680303 | 119 | 0.53134 | [
"vector",
"model",
"transform",
"3d"
] |
d009bd50a3fa4a373a216221272c187c128bbe11 | 3,271 | cpp | C++ | src/Temporal/features/RelationSourceFeature.cpp | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | 1 | 2022-03-24T19:57:00.000Z | 2022-03-24T19:57:00.000Z | src/Temporal/features/RelationSourceFeature.cpp | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | src/Temporal/features/RelationSourceFeature.cpp | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | /*#include "Generic/common/leak_detection.h"
#include "Temporal/features/RelationSourceFeature.h"
#include <sstream>
#include <boost/foreach.hpp>
#include <boost/functional/hash.hpp>
#include <boost/make_shared.hpp>
#include "Generic/common/SessionLogger.h"
#include "Generic/theories/SentenceTheory.h"
#include "Generic/theories/DocTheory.h"
#include "PredFinder/elf/ElfRelation.h"
#include "Temporal/TemporalInstance.h"
#include "Temporal/TemporalAttribute.h"
// Studio is over-paranoid about bounds checking for the boost string
// classification module, so we wrap its import statement with pragmas
// that tell studio to not display warnings about it. For more info:
// <http://msdn.microsoft.com/en-us/library/ttcz0bys.aspx>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable:4996)
# include "boost/algorithm/string/classification.hpp"
# pragma warning(pop)
#else
# include "boost/algorithm/string/classification.hpp"
#endif
using std::wstring;
using std::wstringstream;
using std::vector;
using boost::dynamic_pointer_cast;
using boost::make_shared;
using boost::algorithm::split;
using boost::is_any_of;
RelationSourceFeature::RelationSourceFeature(const std::wstring& sourceComponent,
const Symbol& relation)
: TemporalFeature(L"Source", relation), _sourceComponent(sourceComponent)
{ }
RelationSourceFeature_ptr RelationSourceFeature::create(
const std::vector<std::wstring>& parts, const Symbol& relation)
{
if (parts.empty()) {
throw UnexpectedInputException("RelationSourceFeature::create",
"No metadata provided.");
}
if (parts.size() != 1) {
throw UnexpectedInputException("RelationSourceFeature::create",
"Expected exactly one field of metadata");
}
return make_shared<RelationSourceFeature>(parts[0], relation);
}
std::wstring RelationSourceFeature::pretty() const {
wstringstream str;
str << L"Source(" << relation().to_string() << L", " << _sourceComponent << L")";
return str.str();
}
std::wstring RelationSourceFeature::dump() const {
return pretty();
}
std::wstring RelationSourceFeature::metadata() const {
wstringstream str;
TemporalFeature::metadata(str);
str << L"\t" << _sourceComponent;
return str.str();
}
bool RelationSourceFeature::equals(const TemporalFeature_ptr& other) const {
if (!topEquals(other)) {
return false;
}
if (RelationSourceFeature_ptr rsf =
dynamic_pointer_cast<RelationSourceFeature>(other)) {
return _sourceComponent == rsf->_sourceComponent;
}
return false;
}
size_t RelationSourceFeature::calcHash() const {
size_t ret = topHash();
boost::hash_combine(ret, _sourceComponent);
return ret;
}
bool RelationSourceFeature::matches(TemporalInstance_ptr inst,
const DocTheory* dt, unsigned int sn) const
{
if (!relationNameMatches(inst)) {
return false;
}
if (inst->provenance) {
BOOST_FOREACH(const wstring& provComp, *inst->provenance) {
if (provComp == _sourceComponent) {
return true;
}
}
}
return false;
}
void RelationSourceFeature::addFeaturesToInstance(const TemporalInstance& inst,
std::vector<TemporalFeature_ptr>& fv)
{
if (inst.provenance) {
BOOST_FOREACH(std::wstring& part, *inst.provenance) {
fv.push_back(make_shared<RelationSourceFeature>(
part, inst.relation()->get_name()));
}
}
}
*/
| 26.593496 | 82 | 0.748701 | [
"vector"
] |
d0187195255c805561f8d74050d1ab070e15ca9e | 2,148 | cpp | C++ | src/deploy.cpp | JamesZook/libtree | 6ba310bdd85822e5bf674530be50b4b6839f7a5d | [
"MIT"
] | null | null | null | src/deploy.cpp | JamesZook/libtree | 6ba310bdd85822e5bf674530be50b4b6839f7a5d | [
"MIT"
] | null | null | null | src/deploy.cpp | JamesZook/libtree | 6ba310bdd85822e5bf674530be50b4b6839f7a5d | [
"MIT"
] | null | null | null | #include <sstream>
#include <libtree/deploy.hpp>
#include <libtree/exec.hpp>
#include <termcolor/termcolor.hpp>
// Copy binaries over, change their rpath if they have it, and strip them
void deploy(std::vector<Elf> const &deps, fs::path const &bin, fs::path const &lib, fs::path const &chrpath_path, fs::path const &strip_path, bool chrpath, bool strip) {
for (auto const &elf : deps) {
// Go through all symlinks.
auto canonical = fs::canonical(elf.abs_path);
// Copy to the deploy folder
auto deploy_folder = (elf.type == deploy_t::EXECUTABLE ? bin : lib);
auto deploy_path = deploy_folder / canonical.filename();
try {
fs::copy_file(canonical, deploy_path, fs::copy_options::overwrite_existing);
} catch (fs::filesystem_error& e) {
std::cerr << "Could not overwrite existing file. Skipping with error:\n\t"
<< e.what() << '\n';
}
std::cout << termcolor::green << canonical << termcolor::reset << " => " << termcolor::green << deploy_path << termcolor::reset << '\n';
// Create all symlinks
for (auto link = elf.abs_path; fs::is_symlink(link) && link.filename() != canonical.filename(); link = fs::read_symlink(link)) {
auto link_destination = deploy_folder / link.filename();
fs::remove(link_destination);
fs::create_symlink(deploy_path.filename(), link_destination);
std::cout << " " << termcolor::yellow << "creating symlink " << link_destination << termcolor::reset << '\n';
}
auto rpath = (elf.type == deploy_t::EXECUTABLE ? "\\$ORIGIN/../lib" : "\\$ORIGIN");
// Silently patch the rpath and strip things; let's not care if it fails.
if (chrpath) {
std::stringstream chrpath_cmd;
chrpath_cmd << chrpath_path << " -c -r \"" << rpath << "\" " << deploy_path;
exec(chrpath_cmd.str().c_str());
}
if (strip) {
std::stringstream strip_cmd;
strip_cmd << strip_path << ' ' << deploy_path;
exec(strip_cmd.str().c_str());
}
}
}
| 42.117647 | 169 | 0.589851 | [
"vector"
] |
d025776651f238639c6abeef220b2642826f26db | 1,915 | cpp | C++ | HackerRank/University-Codesprint-5/Sword-profit.cpp | TISparta/competitive-programming-solutions | 31987d4e67bb874bf15653565c6418b5605a20a8 | [
"MIT"
] | 1 | 2018-01-30T13:21:30.000Z | 2018-01-30T13:21:30.000Z | HackerRank/University-Codesprint-5/Sword-profit.cpp | TISparta/competitive-programming-solutions | 31987d4e67bb874bf15653565c6418b5605a20a8 | [
"MIT"
] | null | null | null | HackerRank/University-Codesprint-5/Sword-profit.cpp | TISparta/competitive-programming-solutions | 31987d4e67bb874bf15653565c6418b5605a20a8 | [
"MIT"
] | 1 | 2018-08-29T13:26:50.000Z | 2018-08-29T13:26:50.000Z | /**
* > Author : TISparta
* > Date : 09-09-18
* > Tags : DP, Convex Hull Trick
* > Difficulty : 6 / 10
*/
#include<bits/stdc++.h>
using namespace::std;
typedef long long ll;
typedef pair <ll, ll> Point;
const int MAX_N = 3e5;
const ll MOD = 1e9 + 7, INV = (MOD + 1) / 2;
int n, m, sz;
ll a[MAX_N + 10], b[MAX_N + 10], d[MAX_N + 10], q[MAX_N + 10], r[MAX_N + 10], dp[MAX_N + 10], ans;
vector <Point> hull;
inline ll norm (ll a) {
return (a + MOD) % MOD;
}
inline ll add (ll a, ll b) {
a = norm(a);
b = norm(b);
return (a + b) % MOD;
}
inline ll mul (ll a, ll b) {
a = norm(a);
b = norm(b);
return (a * b) % MOD;
}
inline ll cross (Point c, Point x, Point y){
return (x.first - c.first) * (y.second - c.second) - (y.first - c.first) * (x.second - c.second);
}
void insert (Point x){
while (sz > 1) {
Point p1 = hull[sz - 2];
Point p2 = hull.back();
if (cross(p1, p2, x) < 0) break;
hull.pop_back();
sz--;
}
hull.push_back(x);
sz++;
}
ll get (ll x){
int l = 0, r = sz - 1;
while (l < r){
int m = l + (r - l) / 2;
(x * (hull[m].first - hull[m + 1].first) >= hull[m + 1].second - hull[m].second) ? r = m : l = m + 1;
}
return hull[l].second + x * hull[l].first;
}
ll solve (int id){
ll cnt = dp[id] / b[id] + 1;
ll ret = mul(dp[id], cnt);
ll aux = mul(cnt - 1, INV);
aux = mul(cnt, aux);
aux = mul(b[id], aux);
aux = mul(-1, aux);
ret = add(ret, aux);
return ret;
}
int main(){
scanf("%d", &n);
for (int i = 1; i <= n; i++) scanf("%lld %lld %lld %lld %lld", q + i , a + i, b + i, r + i, d + i);
for (int i = n; i >= 1; i--) {
insert({-1LL * i, -r[i]});
dp[i] = 1LL * i * d[i] - (a[i] + b[i]) + q[i] + get(d[i]);
}
for (int i = 1; i <= n; i++) if (dp[i] > 0) ans = add(ans, solve(i));
printf("%lld\n", ans);
return 0;
}
| 22.267442 | 106 | 0.475196 | [
"vector"
] |
d028b2b178b792d42d164b73c30938a4847025d1 | 22,542 | cpp | C++ | extensions/unit/unittest_extension_message.cpp | tschaffter/apl-core-library | 3a05342ba0fa2432c320476795c13e8cd990e8ee | [
"Apache-2.0"
] | 28 | 2019-11-05T12:23:01.000Z | 2022-03-22T10:01:53.000Z | extensions/unit/unittest_extension_message.cpp | alexa/apl-core-library | b0859273851c4f62290d1f85c42bf22eb087fb35 | [
"Apache-2.0"
] | 7 | 2020-03-28T12:44:08.000Z | 2022-01-23T17:02:27.000Z | extensions/unit/unittest_extension_message.cpp | tschaffter/apl-core-library | 3a05342ba0fa2432c320476795c13e8cd990e8ee | [
"Apache-2.0"
] | 15 | 2019-12-25T10:15:52.000Z | 2021-12-30T03:50:00.000Z | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#include "gtest/gtest.h"
#include "alexaext/alexaext.h"
using namespace alexaext;
using namespace rapidjson;
class ExtensionMessageTest : public ::testing::Test {
public:
inline
::testing::AssertionResult IsValid(const Document& d) {
if (d.HasParseError()) {
return ::testing::AssertionFailure() << "Document has parse error at offset "
<< d.GetErrorOffset();
}
if (d.IsObject() && d.ObjectEmpty()) {
return ::testing::AssertionFailure() << "Document is empty object";
} else if (d.IsArray() && d.Empty()) {
return ::testing::AssertionFailure() << "Document is empty array";
} else if (d.IsNull()) {
return ::testing::AssertionFailure() << "Document is null";
}
return ::testing::AssertionSuccess();
}
inline
::testing::AssertionResult IsEqual(const Value& lhs, const Value& rhs) {
if (lhs != rhs) {
return ::testing::AssertionFailure() << "Documents not equal\n"
<< "lhs:\n" << AsPrettyString(lhs)
<< "\nrhs:\n" << AsPrettyString(rhs) << "\n";
}
return ::testing::AssertionSuccess();
}
Document testDocument;
};
static const char* URI = "alexaext:test:10";
static const char* TEST_MESSAGE = R"(
{
"version": "1.2.3",
"method": "TestMethod",
"uri": "alexaext:test:10",
"target": "alexaext:test:10"
}
)";
// Test message class
class TestMessage : public BaseMessage<TestMessage> {
public:
explicit TestMessage(const std::string& version)
: BaseMessage("TestMethod", version) {}
};
TEST_F(ExtensionMessageTest, TestBaseMessage) {
Document rhsDoc = TestMessage("1.2.3").uri(URI);
ASSERT_TRUE(IsValid(rhsDoc));
// creat an "expected" document for comparison
Document lhsDoc;
lhsDoc.Parse(TEST_MESSAGE);
ASSERT_TRUE(IsValid(lhsDoc));
ASSERT_TRUE(IsEqual(lhsDoc, rhsDoc));
}
static const char* REGISTER_MESSAGE = R"(
{
"version": "1.2.3",
"method": "Register",
"uri": "alexaext:test:10",
"target": "alexaext:test:10"
}
)";
TEST_F(ExtensionMessageTest, RegistrationRequest) {
Document rhsDoc = RegistrationRequest("1.2.3").uri(URI);
ASSERT_TRUE(IsValid(rhsDoc));
// creat an "expected" document for comparison
Document lhsDoc;
lhsDoc.Parse(REGISTER_MESSAGE);
ASSERT_TRUE(IsValid(lhsDoc));
ASSERT_TRUE(IsEqual(lhsDoc, rhsDoc));
}
// sample values
static const char* TEST_MAP_VALUES = R"(
{
"key1": 1,
"key2": true,
"key3": "three"
}
)";
// sample values
static const char* TEST_ARRAY_VALUES = R"(
[
1,
true,
"three"
]
)";
static const char* REGISTER_SETTINGS_MESSAGE = R"(
{
"version": "1.2.3",
"method": "Register",
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"settings": {
"key1": 1,
"key2": true,
"key3": "three"
}
}
)";
TEST_F(ExtensionMessageTest, RegistrationRequestWithSettings) {
// Settings are typically extracted from a different document
Document settings;
settings.Parse(TEST_MAP_VALUES);
Document rhsDoc = RegistrationRequest("1.2.3").uri(URI)
.settings(settings);
ASSERT_TRUE(IsValid(rhsDoc));
// creat an "expected" document for comparison
Document lhsDoc;
lhsDoc.Parse(REGISTER_SETTINGS_MESSAGE);
ASSERT_TRUE(IsValid(lhsDoc));
ASSERT_TRUE(IsEqual(lhsDoc, rhsDoc));
}
static const char* REGISTER_FLAGS_MESSAGE = R"(
{
"version": "1.2.3",
"method": "Register",
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"flags": {
"key1": 1,
"key2": true,
"key3": "three"
}
}
)";
TEST_F(ExtensionMessageTest, RegistrationRequestWithFlags) {
// Flags are opaque data passed from runtime
Document flags;
flags.Parse(TEST_MAP_VALUES);
Document rhsDoc = RegistrationRequest("1.2.3").uri(URI)
.flags(flags);
ASSERT_TRUE(IsValid(rhsDoc));
// creat an "expected" document for comparison
Document lhsDoc;
lhsDoc.Parse(REGISTER_FLAGS_MESSAGE);
ASSERT_TRUE(IsValid(lhsDoc));
ASSERT_TRUE(IsEqual(lhsDoc, rhsDoc));
}
// minimal schema for inclusion in message
static const char* SCHEMA = R"(
{
"type": "Schema",
"uri": "alexaext:test:10"
}
)";
// "Golden" example for comparison with builder results
static const char* REGISTER_SUCCESS_MESSAGE = R"(
{
"version": "1.2.3",
"method": "RegisterSuccess",
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"token": "token4",
"environment": {
"key1": 1,
"key2": true,
"key3": "three"
},
"schema": {
"type": "Schema",
"uri": "alexaext:test:10"
}
}
)";
TEST_F(ExtensionMessageTest, RegistrationSuccess) {
// static environment provided by alternate doc
Document environment;
environment.Parse(TEST_MAP_VALUES);
// static schema provided by alternate doc
Document schema;
schema.Parse(SCHEMA);
Document rhsDoc = RegistrationSuccess("1.2.3").uri(URI)
.token("token4")
.environment(environment)
.schema(schema);
ASSERT_TRUE(IsValid(rhsDoc));
// creat an "expected" document for comparison
Document lhsDoc;
lhsDoc.Parse(REGISTER_SUCCESS_MESSAGE);
ASSERT_TRUE(IsValid(lhsDoc));
ASSERT_TRUE(IsEqual(lhsDoc, rhsDoc));
}
// "Golden" example for comparison with builder results
static const char* REGISTER_FAILURE_MESSAGE = R"(
{
"version": "1.2.3",
"method": "RegisterFailure",
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"code": 400,
"message": "Bad Request"
}
)";
TEST_F(ExtensionMessageTest, RegistrationFailure) {
Document rhsDoc = RegistrationFailure("1.2.3").uri(URI)
.errorCode(400).errorMessage("Bad Request");
ASSERT_TRUE(IsValid(rhsDoc));
// creat an "expected" document for comparison
Document lhsDoc;
lhsDoc.Parse(REGISTER_FAILURE_MESSAGE);
ASSERT_TRUE(IsValid(rhsDoc));
ASSERT_TRUE(IsEqual(lhsDoc, rhsDoc));
}
TEST_F(ExtensionMessageTest, RegistrationFailureForUnknownURI) {
rapidjson::Document expected;
expected.Parse(R"(
{
"version": "1.0",
"method": "RegisterFailure",
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"code": 100,
"message": "Unknown extension - uri: alexaext:test:10"
}
)");
ASSERT_TRUE(IsValid(expected));
rapidjson::Document actual = RegistrationFailure::forUnknownURI(URI);
ASSERT_TRUE(IsValid(actual));
ASSERT_TRUE(IsEqual(expected, actual));
}
TEST_F(ExtensionMessageTest, RegistrationFailureForInvalidMessage) {
rapidjson::Document expected;
expected.Parse(R"(
{
"version": "1.0",
"method": "RegisterFailure",
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"code": 200,
"message": "Invalid or malformed message."
}
)");
ASSERT_TRUE(IsValid(expected));
rapidjson::Document actual = RegistrationFailure::forInvalidMessage(URI);
ASSERT_TRUE(IsValid(actual));
ASSERT_TRUE(IsEqual(expected, actual));
}
TEST_F(ExtensionMessageTest, RegistrationFailureForUnknownException) {
rapidjson::Document expected;
expected.Parse(R"(
{
"version": "1.0",
"method": "RegisterFailure",
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"code": 300,
"message": "Unknown Exception."
}
)");
ASSERT_TRUE(IsValid(expected));
rapidjson::Document actual = RegistrationFailure::forUnknownException(URI);
ASSERT_TRUE(IsValid(actual));
ASSERT_TRUE(IsEqual(expected, actual));
}
TEST_F(ExtensionMessageTest, RegistrationFailureForException) {
rapidjson::Document expected;
expected.Parse(R"(
{
"version": "1.0",
"method": "RegisterFailure",
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"code": 400,
"message": "Extension Exception - uri:alexaext:test:10 msg:Something failed"
}
)");
ASSERT_TRUE(IsValid(expected));
rapidjson::Document actual = RegistrationFailure::forException(URI, "Something failed");
ASSERT_TRUE(IsValid(actual));
ASSERT_TRUE(IsEqual(expected, actual));
}
TEST_F(ExtensionMessageTest, RegistrationFailureForFailedCommand) {
rapidjson::Document expected;
expected.Parse(R"(
{
"version": "1.0",
"method": "RegisterFailure",
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"code": 500,
"message": "Failed Command - id: MyCommand"
}
)");
ASSERT_TRUE(IsValid(expected));
rapidjson::Document actual = RegistrationFailure::forFailedCommand(URI, "MyCommand");
ASSERT_TRUE(IsValid(actual));
ASSERT_TRUE(IsEqual(expected, actual));
}
TEST_F(ExtensionMessageTest, RegistrationFailureForInvalidExtensionSchema) {
rapidjson::Document expected;
expected.Parse(R"(
{
"version": "1.0",
"method": "RegisterFailure",
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"code": 600,
"message": "Invalid or malformed extension schema. uri: alexaext:test:10"
}
)");
ASSERT_TRUE(IsValid(expected));
rapidjson::Document actual = RegistrationFailure::forInvalidExtensionSchema(URI);
ASSERT_TRUE(IsValid(actual));
ASSERT_TRUE(IsEqual(expected, actual));
}
// "Golden" example for comparison with builder results
static const char* COMMAND_MESSAGE = R"(
{
"version": "1.2.3",
"method": "Command",
"payload": {
"key1": 1,
"key2": true,
"key3": "three",
"key4": {
"key1": 1,
"key2": true,
"key3": "three"
}
},
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"id": 13,
"name": "myCommand"
}
)";
TEST_F(ExtensionMessageTest, Command) {
// payload using move
Document complexProperty;
complexProperty.Parse(TEST_MAP_VALUES);
Document rhsDoc = Command("1.2.3").uri(URI)
.id(13).name("myCommand")
.property("key1", 1)
.property("key2", true)
.property("key3", "three")
.property("key4", complexProperty.Move());
ASSERT_TRUE(IsValid(rhsDoc));
// creat an "expected" document for comparison
Document lhsDoc;
lhsDoc.Parse(COMMAND_MESSAGE);
ASSERT_TRUE(IsValid(lhsDoc));
ASSERT_TRUE(IsEqual(lhsDoc, rhsDoc));
}
// "Golden" example for comparison with builder results
static const char* COMMAND_SUCCESS_MESSAGE = R"(
{
"version": "1.2.3",
"method": "CommandSuccess",
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"id": 13
}
)";
TEST_F(ExtensionMessageTest, CommandSuccess) {
Document rhsDoc = CommandSuccess("1.2.3").uri(URI)
.id(13);
//TODO Result
ASSERT_TRUE(IsValid(rhsDoc));
// creat an "expected" document for comparison
Document lhsDoc;
lhsDoc.Parse(COMMAND_SUCCESS_MESSAGE);
ASSERT_TRUE(IsValid(lhsDoc));
ASSERT_TRUE(IsEqual(lhsDoc, rhsDoc));
}
// "Golden" example for comparison with builder results
static const char* COMMAND_FAILURE_MESSAGE = R"(
{
"version": "1.2.3",
"method": "CommandFailure",
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"code": 400,
"message": "Bad Request"
}
)";
TEST_F(ExtensionMessageTest, CommandFailure) {
Document rhsDoc = CommandFailure("1.2.3").uri(URI)
.errorCode(400).errorMessage("Bad Request");
ASSERT_TRUE(IsValid(rhsDoc));
// creat an "expected" document for comparison
Document lhsDoc;
lhsDoc.Parse(COMMAND_FAILURE_MESSAGE);
ASSERT_TRUE(IsValid(lhsDoc));
ASSERT_TRUE(IsEqual(lhsDoc, rhsDoc));
}
// "Golden" example for comparison with builder results
static const char* EVENT_MESSAGE = R"(
{
"version": "1.2.3",
"method": "Event",
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"name": "myEvent",
"payload": {
"key1": 1,
"key2": true,
"key3": "three",
"key4": {
"key1": 1,
"key2": true,
"key3": "three"
}
}
}
)";
TEST_F(ExtensionMessageTest, Event) {
// payload uses move semantics
Document doc;
doc.Parse(TEST_MAP_VALUES);
Value complexItem (doc, doc.GetAllocator());
Document rhsDoc = Event("1.2.3").uri(URI)
.name("myEvent")
.property("key1", 1)
.property("key2", true)
.property("key3", "three")
.property("key4", complexItem);
ASSERT_TRUE(IsValid(rhsDoc));
// creat an "expected" document for comparison
Document lhsDoc;
lhsDoc.Parse(EVENT_MESSAGE);
ASSERT_TRUE(IsValid(lhsDoc));
ASSERT_TRUE(IsEqual(lhsDoc, rhsDoc));
}
// "Golden" example for comparison with builder results
static const char* LIVE_DATA_MAP_UPDATE = R"(
{
"version": "1.2.3",
"method": "LiveDataUpdate",
"operations": [
{
"type": "Set",
"key": "key1",
"item": 1
},
{
"type": "Set",
"key": "key2",
"item": true
},
{
"type": "Set",
"key": "key3",
"item": "three"
},
{
"type": "Set",
"key": "key4",
"item": {
"key1": 1,
"key2": true,
"key3": "three"
}
}
],
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"name": "MyLiveDataMap"
}
)";
TEST_F(ExtensionMessageTest, LiveDataMapUpdate) {
// payload uses move item
Document doc;
doc.Parse(TEST_MAP_VALUES);
Value complexItem (doc, doc.GetAllocator());
Document rhsDoc = LiveDataUpdate("1.2.3").uri(URI)
.objectName("MyLiveDataMap")
.liveDataMapUpdate([](LiveDataMapOperation operation) {
operation.type("Set")
.key("key1")
.item(1);
})
.liveDataMapUpdate([](LiveDataMapOperation operation) {
operation.type("Set")
.key("key2")
.item(true);
})
.liveDataMapUpdate([](LiveDataMapOperation operation) {
operation.type("Set")
.key("key3")
.item("three");
})
.liveDataMapUpdate([&complexItem](LiveDataMapOperation operation) {
operation.type("Set")
.key("key4")
.item(complexItem);
});
ASSERT_TRUE(IsValid(rhsDoc));
// creat an "expected" document for comparison
Document lhsDoc;
lhsDoc.Parse(LIVE_DATA_MAP_UPDATE);
ASSERT_TRUE(IsValid(lhsDoc));
ASSERT_TRUE(IsEqual(lhsDoc, rhsDoc));
}
// "Golden" example for comparison with builder results
static const char* LIVE_DATA_ARRAY_UPDATE = R"(
{
"version": "1.2.3",
"method": "LiveDataUpdate",
"operations": [
{
"type": "Insert",
"index": 1,
"item": 1
},
{
"type": "Insert",
"index": 2,
"item": true
},
{
"type": "Insert",
"index": 3,
"item": "three"
},
{
"type": "Insert",
"index": 4,
"item": [
1,
true,
"three"
]
},
{
"type": "Remove",
"count": 3
}
],
"uri": "alexaext:test:10",
"target": "alexaext:test:10",
"name": "MyLiveDataArray"
}
)";
TEST_F(ExtensionMessageTest, LiveDataArrayUpdate) {
// payload uses move item
Document doc;
doc.Parse(TEST_ARRAY_VALUES);
Value complexItem (doc, doc.GetAllocator());
Document rhsDoc = LiveDataUpdate("1.2.3")
.uri(URI)
.objectName("MyLiveDataArray")
.liveDataArrayUpdate([](LiveDataArrayOperation operation) {
operation.type("Insert")
.index(1)
.item(1);
})
.liveDataArrayUpdate([](LiveDataArrayOperation operation) {
operation.type("Insert")
.index(2)
.item(true);
})
.liveDataArrayUpdate([](LiveDataArrayOperation operation) {
operation.type("Insert")
.index(3)
.item("three");
})
.liveDataArrayUpdate([&complexItem](LiveDataArrayOperation operation) {
operation.type("Insert")
.index(4)
.item(complexItem);
})
.liveDataArrayUpdate([](LiveDataArrayOperation operation) {
operation.type("Remove").count(3);
});
ASSERT_TRUE(IsValid(rhsDoc));
// creat an "expected" document for comparison
Document lhsDoc;
lhsDoc.Parse(LIVE_DATA_ARRAY_UPDATE);
ASSERT_TRUE(IsValid(lhsDoc));
ASSERT_TRUE(IsEqual(lhsDoc, rhsDoc));
}
static const char* SAMPLE_ENVIRONMENT = R"(
{
"integral": 42,
"float": 42.0,
"fractional": 42.5,
"bool": true,
"string": "Hello, my name is Inigo Montoya",
"null": null
}
)";
TEST_F(ExtensionMessageTest, GetWithDefault) {
Document env;
env.Parse(SAMPLE_ENVIRONMENT);
ASSERT_TRUE(IsValid(env));
ASSERT_EQ(42, GetWithDefault<int>("integral", env, 0));
ASSERT_EQ(42, GetWithDefault<unsigned int>("integral", env, 0));
ASSERT_EQ(42.0, GetWithDefault<double>("integral", env, 0));
ASSERT_EQ(42.0f, GetWithDefault<float>("integral", env, 0));
ASSERT_EQ(42, GetWithDefault<int>("float", env, 0));
ASSERT_EQ(42, GetWithDefault<unsigned int>("float", env, 0));
ASSERT_EQ(42.0, GetWithDefault<double>("float", env, 0));
ASSERT_EQ(42.0f, GetWithDefault<float>("float", env, 0));
ASSERT_EQ(42, GetWithDefault<int>("fractional", env, 0));
ASSERT_EQ(42, GetWithDefault<unsigned int>("fractional", env, 0));
ASSERT_EQ(42.5, GetWithDefault<double>("fractional", env, 0));
ASSERT_EQ(42.5f, GetWithDefault<float>("fractional", env, 0));
ASSERT_TRUE(GetWithDefault<bool>("bool", env, false));
ASSERT_TRUE(GetWithDefault<bool>("integral", env, false));
ASSERT_TRUE(GetWithDefault<bool>("float", env, false));
ASSERT_TRUE(GetWithDefault<bool>("fractional", env, false));
ASSERT_STREQ("Hello, my name is Inigo Montoya", GetWithDefault("string", env, ""));
ASSERT_EQ(std::string("Hello, my name is Inigo Montoya"), GetWithDefault<std::string>("string", env, std::string()));
ASSERT_EQ(1, GetWithDefault<int>("null", env, 1));
ASSERT_EQ(1, GetWithDefault<unsigned int>("null", env, 1));
ASSERT_EQ(1.0, GetWithDefault<double>("null", env, 1));
ASSERT_EQ(1.0f, GetWithDefault<float>("null", env, 1));
ASSERT_STREQ("default", GetWithDefault("null", env, "default"));
ASSERT_EQ("default", GetWithDefault<std::string>("null", env, std::string("default")));
ASSERT_EQ(1, GetWithDefault<int>("missing", env, 1));
ASSERT_EQ(1, GetWithDefault<unsigned int>("missing", env, 1));
ASSERT_EQ(1.0, GetWithDefault<double>("missing", env, 1));
ASSERT_EQ(1.0f, GetWithDefault<float>("missing", env, 1));
ASSERT_STREQ("default", GetWithDefault("missing", env, "default"));
ASSERT_EQ("default", GetWithDefault<std::string>("missing", env, std::string("default")));
rapidjson::Value null;
null.SetNull();
ASSERT_EQ(1, GetWithDefault<int>("missing", null, 1));
ASSERT_EQ(1, GetWithDefault<unsigned int>("missing", null, 1));
ASSERT_EQ(1.0, GetWithDefault<double>("missing", null, 1));
ASSERT_EQ(1.0f, GetWithDefault<float>("missing", null, 1));
ASSERT_STREQ("default", GetWithDefault("missing", null, "default"));
ASSERT_EQ("default", GetWithDefault<std::string>("missing", null, std::string("default")));
rapidjson::Value array;
array.SetArray();
ASSERT_EQ(1, GetWithDefault<int>("missing", array, 1));
ASSERT_EQ(1, GetWithDefault<unsigned int>("missing", array, 1));
ASSERT_EQ(1.0, GetWithDefault<double>("missing", array, 1));
ASSERT_EQ(1.0f, GetWithDefault<float>("missing", array, 1));
ASSERT_STREQ("default", GetWithDefault("missing", array, "default"));
ASSERT_EQ("default", GetWithDefault<std::string>("missing", array, std::string("default")));
rapidjson::Value number;
number.SetDouble(1.0);
ASSERT_EQ(1, GetWithDefault<int>("missing", number, 1));
ASSERT_EQ(1, GetWithDefault<unsigned int>("missing", number, 1));
ASSERT_EQ(1.0, GetWithDefault<double>("missing", number, 1));
ASSERT_EQ(1.0f, GetWithDefault<float>("missing", number, 1));
ASSERT_STREQ("default", GetWithDefault("missing", number, "default"));
ASSERT_EQ("default", GetWithDefault<std::string>("missing", number, std::string("default")));
// Null root variant
ASSERT_EQ(1, GetWithDefault<int>("missing", nullptr, 1));
ASSERT_EQ(1, GetWithDefault<unsigned int>("missing", nullptr, 1));
ASSERT_EQ(1.0, GetWithDefault<double>("missing", nullptr, 1));
ASSERT_EQ(1.0f, GetWithDefault<float>("missing", nullptr, 1));
ASSERT_STREQ("default", GetWithDefault("missing", nullptr, "default"));
ASSERT_EQ("default", GetWithDefault<std::string>("missing", nullptr, std::string("default")));
} | 28.570342 | 121 | 0.594402 | [
"object"
] |
d0293a646036cb0c79069016ebaa3f55dc5f945b | 9,618 | cpp | C++ | src/PfcCompress.cpp | avr-aics-riken/PFClib | aaf08cc3a5f2e3df79ca4bfd834627e1adb58887 | [
"BSD-2-Clause"
] | 2 | 2015-03-17T17:31:34.000Z | 2019-01-31T15:17:11.000Z | src/PfcCompress.cpp | avr-aics-riken/PFClib | aaf08cc3a5f2e3df79ca4bfd834627e1adb58887 | [
"BSD-2-Clause"
] | null | null | null | src/PfcCompress.cpp | avr-aics-riken/PFClib | aaf08cc3a5f2e3df79ca4bfd834627e1adb58887 | [
"BSD-2-Clause"
] | null | null | null | /*
* PFClib - Parallel File Compression library
*
* Copyright (c) 2013-2014 Advanced Institute for Computational Science, RIKEN.
* All rights reserved.
*
*/
/**
* @file PfcCompress.cpp
* @brief CPfcCompress Class
* @author aics
*/
#include "PfcCompress.h"
#include "PfcCioDfiUtil.h"
#include "PfcPathUtil.h"
#include "PfcFunction.h"
// #################################################################
// コンストラクタ
CPfcCompress::CPfcCompress( void )
{
m_dfiFilePath = "";
m_outDirPath = "";
m_compressFormat = "";
m_compressError = D_PFC_COMPRESS_ERROR_DEFAULT;
m_domainDivision[0] = 0;
m_domainDivision[1] = 0;
m_domainDivision[2] = 0;
m_startStep = 0;
m_endStep = 0;
m_optFlags = 0;
m_pDfiIN = NULL;
}
// #################################################################
// デストラクタ
CPfcCompress::~CPfcCompress()
{
if( m_pDfiIN != NULL ) {
delete m_pDfiIN;
}
}
// #################################################################
// 圧縮クラス 初期化
PFC::E_PFC_ERRORCODE
CPfcCompress::Init(
const MPI_Comm comm,
const std::string& dfiFilePath,
const std::string& outDirPath,
const std::string& compressFormat,
const double compressError,
const int domainDivision[3]
)
{
PFC::E_PFC_ERRORCODE ret;
ret = Init(
comm, dfiFilePath, outDirPath,
compressFormat, compressError, domainDivision,
-1, -1,
0
);
return ret;
}
// #################################################################
// 圧縮クラス 初期化
PFC::E_PFC_ERRORCODE
CPfcCompress::Init(
const MPI_Comm comm,
const std::string& dfiFilePath,
const std::string& outDirPath,
const std::string& compressFormat,
const double compressError,
const int domainDivision[3],
const int startStep,
const int endStep,
const int optFlags
)
{
CIO::E_CIO_ERRORCODE ret_cio;
PFC::E_PFC_ERRORCODE ret;
#ifdef USE_PMLIB
PfcPerfMon::Start(t10_c);
#endif
#ifdef USE_PMLIB
PfcPerfMon::Start(t101_c);
#endif
m_comm = comm;
m_dfiFilePath = dfiFilePath;
m_outDirPath = outDirPath;
m_compressFormat = compressFormat;
m_compressError = compressError;
m_domainDivision[0] = domainDivision[0];
m_domainDivision[1] = domainDivision[1];
m_domainDivision[2] = domainDivision[2];
m_startStep = startStep;
m_endStep = endStep;
m_optFlags = optFlags;
ret = PFC::MakeDirectory( m_outDirPath );
if( ret != PFC::E_PFC_SUCCESS ) {
PFC_PRINT("### ERROR ###\n");
return ret;
}
// ランク数、ランクID取得
MPI_Comm_size( comm, &m_numRank );
MPI_Comm_rank( comm, &m_myRankID );
// 全体ステップ数取得
vector<int> timeStepList;
#ifdef USE_PMLIB
PfcPerfMon::Start(t102_c);
#endif
ret = CPfcCioDfiUtil::GetDfiTimeStepList( m_dfiFilePath, timeStepList );
#ifdef USE_PMLIB
PfcPerfMon::Stop(t102_c);
#endif
if( ret != PFC::E_PFC_SUCCESS || timeStepList.size() == 0 ) {
PFC_PRINT("### ERROR ###\n");
return ret;
}
// 対象ステップ設定
if( m_startStep == -1 ) {
m_startStep = timeStepList[0];
}
if( m_endStep == -1 ) {
m_endStep = timeStepList[ timeStepList.size()-1 ];
}
// 指定ステップ有無チェック
int ist_pos = -1;
int iend_pos = -1;
for( int i = 0; i<timeStepList.size(); i++ ) {
if( m_startStep == timeStepList[i] ) {
ist_pos = i;
}
if( m_endStep == timeStepList[i] ) {
iend_pos = i;
}
}
if( ist_pos==-1 || iend_pos==-1 ) {
PFC_PRINT("### ERROR ###\n");
return PFC::E_PFC_ERROR;
}
// 対象のみコピー
m_stepList.clear();
for(int i=ist_pos; i<=iend_pos; i++ ) {
m_stepList.push_back( timeStepList[i] );
}
m_numStep = m_stepList.size();
if( m_numStep < 2 ) {
PFC_PRINT("### ERROR number of steps is short. m_numStep=%d\n",m_numStep );
return PFC::E_PFC_ERROR;
}
if( m_compressFormat == "pod" )
{
// 時間軸方向の並列数 取得
m_numParallel = CPfcFunction::GetPodParallel( m_numStep );
}
else
{
PFC_PRINT("### ERROR Compress Format Error=%s\n",m_compressFormat.c_str() );
return PFC::E_PFC_ERROR_PFC_COMPRESSFORMAT;
}
// 並列数チェック
m_numRegion = m_domainDivision[0]*m_domainDivision[1]*m_domainDivision[2];
if( m_numRegion*m_numParallel != m_numRank ) {
PFC_PRINT("### ERROR numRank=%d numRegion=%d numParallel=%d numStep=%d\n",
m_numRank,m_numRegion,m_numParallel, m_numStep );
return PFC::E_PFC_ERROR;
}
// DFI Domain情報取得 for cio_DFI::ReadInit() GVoxel
cio_Domain domain;
ret = CPfcCioDfiUtil::GetDfiDomain( m_dfiFilePath, domain );
if( ret != PFC::E_PFC_SUCCESS ) {
PFC_PRINT("### ERROR ###\n");
return ret;
}
// CIO DFI 読み込みインスタンス
#ifdef USE_PMLIB
PfcPerfMon::Start(t103_c);
#endif
m_pDfiIN = cio_DFI::ReadInit(
m_comm,
m_dfiFilePath,
domain.GlobalVoxel,
domain.GlobalDivision,
ret_cio );
#ifdef USE_PMLIB
PfcPerfMon::Stop(t103_c);
#endif
if( ret_cio != CIO::E_CIO_SUCCESS || m_pDfiIN == NULL ) {
PFC_PRINT("### ERROR cio_DFI::ReadInit() dfiFilePath=%s\n",m_dfiFilePath.c_str() );
return PFC::E_PFC_ERROR;
}
// 属性情報の設定
const cio_FileInfo* pDfiFileInfo = m_pDfiIN->GetcioFileInfo();
// ファイルフォーマット、配列形状チェック
if( pDfiFileInfo->FileFormat == CIO::E_CIO_FMT_SPH ) {
if( pDfiFileInfo->ArrayShape == CIO::E_CIO_NIJK ) {
} else {
PFC_PRINT("### ERROR SPH file ArrayShape error. NIJK is only available.\n");
return PFC::E_PFC_ERROR;
}
}
m_prefix = pDfiFileInfo->Prefix;
if( m_compressFormat == "pod" )
{
m_fileFormat= "pod";
}
else
{
PFC_PRINT("### ERROR Compress Format Error=%s\n",m_compressFormat.c_str() );
return PFC::E_PFC_ERROR_PFC_COMPRESSFORMAT;
}
if( pDfiFileInfo->DataType == CIO::E_CIO_FLOAT32 ) {
m_dataType = PFC::E_PFC_FLOAT32;
} else if( pDfiFileInfo->DataType == CIO::E_CIO_FLOAT64 ) {
m_dataType = PFC::E_PFC_FLOAT32;
} else {
PFC_PRINT("### ERROR DataType Error=%d\n",pDfiFileInfo->DataType );
return PFC::E_PFC_ERROR;
}
if( pDfiFileInfo->ArrayShape == CIO::E_CIO_IJKN ) {
m_arrayShape = PFC::E_PFC_IJKN;
} else if( pDfiFileInfo->ArrayShape == CIO::E_CIO_NIJK ) {
m_arrayShape = PFC::E_PFC_NIJK;
} else {
PFC_PRINT("### ERROR ArrayShape Error=%d\n",pDfiFileInfo->ArrayShape );
return PFC::E_PFC_ERROR;
}
m_numComponent = pDfiFileInfo->Component;
int idumy = 1;
char* cdumy = (char*)(&idumy);
if( cdumy[0] == 0x01 ) {
m_endianType = PFC::E_PFC_LITTLE;
} else if ( cdumy[0] == 0x00 ) {
m_endianType = PFC::E_PFC_BIG;
}
// 分割領域毎の情報
if( m_compressFormat == "pod" )
{
ret = CPfcFunction::GetPodRegionID(
m_myRankID, // (in) ランクID
m_numStep, // (in) ステップ数
m_regionID, // (out) 領域ID (0起点)
m_myIDinRegion, // (out) 領域内のID (0起点)
m_regionMasterRankID // (out) 分割領域内のマスターランクID
);
}
else
{
PFC_PRINT("### ERROR Compress Format Error=%s\n",m_compressFormat.c_str() );
return PFC::E_PFC_ERROR_PFC_COMPRESSFORMAT;
}
// 分割計算領域の開始位置&終了位置取得
CPfcFunction::CalcHeadTail (
domain.GlobalVoxel,
m_domainDivision,
m_regionID,
m_regionHead, m_regionTail
);
m_regionSize = m_numComponent
* (m_regionTail[0]-m_regionHead[0]+1)
* (m_regionTail[1]-m_regionHead[1]+1)
* (m_regionTail[2]-m_regionHead[2]+1);
#ifdef USE_PMLIB
PfcPerfMon::Stop(t101_c);
#endif
if( m_compressFormat == "pod" )
{
m_pCioPod = new CPfcCompressCioPod();
#ifdef USE_PMLIB
PfcPerfMon::Start(t105_c);
#endif
ret = m_pCioPod->Init( m_comm,
m_pDfiIN,
m_outDirPath,
m_compressError,
m_numRegion,
m_regionHead,
m_regionTail,
&m_stepList,
m_optFlags
);
#ifdef USE_PMLIB
PfcPerfMon::Stop(t105_c);
#endif
if( ret != PFC::E_PFC_SUCCESS ) {
PFC_PRINT("### ERROR CompressCioPod initialize erro\n" );
return ret;
}
}
else
{
PFC_PRINT("### ERROR Compress Format Error=%s\n",m_compressFormat.c_str() );
return PFC::E_PFC_ERROR_PFC_COMPRESSFORMAT;
}
#ifdef USE_PMLIB
PfcPerfMon::Stop(t10_c);
#endif
return PFC::E_PFC_SUCCESS;
}
// #################################################################
// 圧縮&ファイル出力実行
PFC::E_PFC_ERRORCODE
CPfcCompress::WriteData( void )
{
#ifdef USE_PMLIB
PfcPerfMon::Start(t30_c);
#endif
// 圧縮&POD(基底ファイル、係数ファイル)出力
// ・基底ファイル、係数ファイル 出力
#ifdef USE_PMLIB
PfcPerfMon::Start(t301_c);
#endif
m_pCioPod->WriteData();
#ifdef USE_PMLIB
PfcPerfMon::Stop(t301_c);
#endif
// index.pfcファイル 出力
#ifdef USE_PMLIB
PfcPerfMon::Start(t302_c);
#endif
WriteIndexPfcFile();
#ifdef USE_PMLIB
PfcPerfMon::Stop(t302_c);
#endif
#ifdef USE_PMLIB
PfcPerfMon::Stop(t30_c);
#endif
return PFC::E_PFC_SUCCESS;
}
| 25.648 | 88 | 0.56623 | [
"vector"
] |
d02db56f54a4cffff17df7b2634898e2151d783c | 106,840 | cpp | C++ | parser/preprocessed/SqlLexer_gen.cpp | craig-chasseur/incubator-quickstep | 00ca1e4b3a9c9838dcb9509058b8a40b0f573617 | [
"Apache-2.0"
] | null | null | null | parser/preprocessed/SqlLexer_gen.cpp | craig-chasseur/incubator-quickstep | 00ca1e4b3a9c9838dcb9509058b8a40b0f573617 | [
"Apache-2.0"
] | null | null | null | parser/preprocessed/SqlLexer_gen.cpp | craig-chasseur/incubator-quickstep | 00ca1e4b3a9c9838dcb9509058b8a40b0f573617 | [
"Apache-2.0"
] | 1 | 2021-12-04T18:48:44.000Z | 2021-12-04T18:48:44.000Z | #line 2 "SqlLexer_gen.cpp"
#line 4 "SqlLexer_gen.cpp"
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 39
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
/* end standard C headers. */
/* flex integer type definitions */
#ifndef FLEXINT_H
#define FLEXINT_H
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
#endif
#include <inttypes.h>
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
/* Limits of integral types. */
#ifndef INT8_MIN
#define INT8_MIN (-128)
#endif
#ifndef INT16_MIN
#define INT16_MIN (-32767-1)
#endif
#ifndef INT32_MIN
#define INT32_MIN (-2147483647-1)
#endif
#ifndef INT8_MAX
#define INT8_MAX (127)
#endif
#ifndef INT16_MAX
#define INT16_MAX (32767)
#endif
#ifndef INT32_MAX
#define INT32_MAX (2147483647)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX (255U)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX (65535U)
#endif
#ifndef UINT32_MAX
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
#else /* ! __cplusplus */
/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)
#define YY_USE_CONST
#endif /* defined (__STDC__) */
#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
/* Promotes a possibly negative, possibly signed char to an unsigned
* integer for use as an array index. If the signed char is negative,
* we want to instead treat it as an 8-bit unsigned char, hence the
* double cast.
*/
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
#define YY_TYPEDEF_YY_SCANNER_T
typedef void* yyscan_t;
#endif
/* For convenience, these vars (plus the bison vars far below)
are macros in the reentrant scanner. */
#define yyin yyg->yyin_r
#define yyout yyg->yyout_r
#define yyextra yyg->yyextra_r
#define yyleng yyg->yyleng_r
#define yytext yyg->yytext_r
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
#define yy_flex_debug yyg->yy_flex_debug_r
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN yyg->yy_start = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yyg->yy_start - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE quickstep_yyrestart(yyin ,yyscanner )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
*/
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
/* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
* access to the local variable yy_act. Since yyless() is a macro, it would break
* existing scanners that call yyless() from OUTSIDE quickstep_yylex.
* One obvious solution it to make yy_act a global. I tried that, and saw
* a 5% performance hit in a non-yylineno scanner, because yy_act is
* normally declared as a register variable-- so it is not worth it.
*/
#define YY_LESS_LINENO(n) \
do { \
int yyl;\
for ( yyl = n; yyl < yyleng; ++yyl )\
if ( yytext[yyl] == '\n' )\
--yylineno;\
}while(0)
#define YY_LINENO_REWIND_TO(dst) \
do {\
const char *p;\
for ( p = yy_cp-1; p >= (dst); --p)\
if ( *p == '\n' )\
--yylineno;\
}while(0)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = yyg->yy_hold_char; \
YY_RESTORE_YY_MORE_OFFSET \
yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
FILE *yy_input_file;
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
yy_size_t yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
* shouldn't try reading from the input source any more. We might
* still have a bunch of tokens to match, though, because of
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
* (via quickstep_yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
*
* Returns the top of the stack, or NULL.
*/
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
: NULL)
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
void quickstep_yyrestart (FILE *input_file ,yyscan_t yyscanner );
void quickstep_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
YY_BUFFER_STATE quickstep_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
void quickstep_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
void quickstep_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
void quickstep_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
void quickstep_yypop_buffer_state (yyscan_t yyscanner );
static void quickstep_yyensure_buffer_stack (yyscan_t yyscanner );
static void quickstep_yy_load_buffer_state (yyscan_t yyscanner );
static void quickstep_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
#define YY_FLUSH_BUFFER quickstep_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
YY_BUFFER_STATE quickstep_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
YY_BUFFER_STATE quickstep_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
YY_BUFFER_STATE quickstep_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
void *quickstep_yyalloc (yy_size_t ,yyscan_t yyscanner );
void *quickstep_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
void quickstep_yyfree (void * ,yyscan_t yyscanner );
#define yy_new_buffer quickstep_yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
quickstep_yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
quickstep_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
quickstep_yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
quickstep_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
#define quickstep_yywrap(yyscanner) 1
#define YY_SKIP_YYWRAP
typedef unsigned char YY_CHAR;
typedef int yy_state_type;
#define yytext_ptr yytext_r
static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
static int yy_get_next_buffer (yyscan_t yyscanner );
static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
yyg->yytext_ptr = yy_bp; \
yyleng = (size_t) (yy_cp - yy_bp); \
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 160
#define YY_END_OF_BUFFER 161
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
{
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_accept[588] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 161, 2, 2, 159, 159, 158, 157, 159,
136, 132, 135, 132, 132, 155, 128, 125, 129, 154,
154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
154, 154, 154, 154, 133, 4, 5, 5, 3, 151,
151, 148, 152, 152, 146, 153, 153, 150, 1, 158,
126, 156, 155, 155, 155, 0, 130, 127, 131, 154,
154, 154, 154, 10, 154, 154, 154, 22, 154, 154,
154, 154, 154, 154, 154, 154, 154, 154, 154, 134,
154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
154, 154, 154, 60, 68, 154, 154, 154, 154, 154,
154, 154, 154, 154, 154, 154, 82, 83, 154, 154,
154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
154, 154, 154, 4, 5, 3, 151, 147, 152, 145,
145, 137, 139, 140, 141, 142, 143, 144, 145, 153,
149, 156, 155, 0, 155, 6, 7, 154, 9, 11,
154, 154, 15, 154, 154, 154, 154, 154, 154, 154,
154, 154, 154, 154, 33, 154, 154, 154, 154, 154,
154, 154, 154, 44, 154, 154, 154, 154, 154, 154,
154, 52, 154, 154, 154, 154, 154, 154, 154, 154,
154, 64, 154, 70, 154, 154, 154, 154, 154, 154,
154, 78, 154, 81, 154, 154, 154, 154, 154, 154,
154, 154, 154, 154, 154, 154, 154, 98, 154, 154,
103, 104, 154, 154, 154, 154, 154, 154, 154, 154,
154, 154, 154, 154, 154, 154, 154, 154, 137, 139,
138, 154, 154, 154, 154, 154, 154, 154, 20, 23,
154, 154, 154, 28, 154, 154, 154, 31, 154, 154,
154, 154, 38, 154, 154, 42, 43, 154, 154, 154,
154, 154, 154, 154, 154, 54, 55, 154, 57, 154,
59, 154, 154, 154, 154, 67, 69, 71, 72, 73,
154, 75, 154, 154, 79, 154, 154, 86, 154, 154,
154, 154, 92, 154, 94, 154, 154, 154, 100, 154,
154, 154, 154, 154, 154, 108, 109, 111, 154, 154,
154, 154, 154, 154, 154, 119, 154, 154, 122, 123,
137, 138, 8, 154, 154, 154, 154, 154, 154, 154,
25, 154, 154, 154, 154, 154, 154, 154, 154, 154,
154, 154, 154, 154, 154, 154, 154, 48, 49, 50,
154, 154, 56, 154, 61, 62, 154, 154, 154, 74,
154, 77, 80, 84, 85, 154, 154, 154, 154, 93,
154, 154, 97, 154, 154, 154, 154, 154, 107, 154,
154, 154, 154, 154, 116, 154, 154, 120, 154, 154,
154, 154, 14, 154, 154, 154, 154, 154, 26, 154,
29, 154, 154, 154, 154, 154, 36, 154, 154, 154,
41, 154, 46, 154, 154, 154, 58, 63, 154, 154,
76, 154, 154, 154, 154, 154, 96, 154, 101, 102,
154, 154, 154, 154, 154, 114, 115, 117, 154, 121,
154, 154, 13, 154, 154, 154, 154, 154, 154, 21,
30, 154, 34, 35, 154, 154, 154, 154, 47, 154,
53, 65, 154, 154, 89, 154, 91, 154, 154, 154,
154, 154, 154, 154, 118, 154, 154, 154, 154, 154,
154, 154, 154, 32, 154, 154, 40, 154, 154, 66,
154, 154, 154, 154, 105, 154, 154, 154, 154, 154,
12, 154, 154, 154, 154, 24, 154, 37, 154, 154,
51, 87, 90, 154, 154, 106, 110, 154, 113, 124,
16, 154, 154, 154, 27, 39, 154, 88, 95, 154,
154, 154, 18, 19, 154, 154, 112, 154, 154, 154,
154, 154, 99, 154, 45, 17, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 5, 6, 1, 1, 7, 1, 8, 7,
7, 7, 9, 7, 10, 11, 7, 12, 12, 12,
12, 12, 12, 12, 12, 13, 13, 14, 7, 15,
16, 17, 1, 1, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 44, 1, 46, 1, 47, 48, 49, 50,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 43, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
static yyconst flex_int32_t yy_meta[72] =
{ 0,
1, 1, 2, 1, 1, 3, 1, 4, 1, 5,
5, 6, 6, 5, 1, 1, 1, 7, 7, 7,
7, 7, 7, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 1, 9, 10, 7, 7, 7, 7,
7, 7, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8
} ;
static yyconst flex_int16_t yy_base[603] =
{ 0,
0, 1, 46, 0, 117, 163, 2, 3, 128, 132,
6, 10, 211, 1307, 1307, 0, 1307, 13, 1307, 194,
1307, 1307, 1307, 194, 6, 130, 4, 1307, 170, 124,
161, 215, 170, 207, 265, 92, 167, 162, 96, 107,
223, 165, 162, 221, 274, 92, 284, 277, 315, 206,
128, 232, 0, 125, 1307, 152, 4, 19, 0, 0,
0, 143, 0, 0, 379, 0, 0, 144, 0, 22,
1307, 0, 292, 305, 335, 18, 1307, 1307, 1307, 0,
174, 264, 180, 186, 209, 271, 229, 0, 277, 333,
335, 312, 330, 317, 323, 338, 323, 333, 340, 1307,
339, 355, 357, 381, 370, 373, 377, 382, 380, 384,
383, 383, 383, 431, 0, 398, 383, 390, 406, 402,
403, 404, 425, 420, 431, 442, 0, 445, 432, 448,
436, 437, 451, 448, 444, 460, 452, 439, 489, 464,
468, 469, 468, 462, 455, 477, 501, 493, 489, 494,
502, 494, 510, 142, 29, 0, 0, 1307, 0, 1307,
1307, 22, 24, 1307, 1307, 1307, 1307, 1307, 0, 0,
1307, 0, 520, 26, 28, 0, 0, 508, 0, 512,
495, 510, 497, 530, 518, 506, 525, 508, 512, 509,
543, 530, 533, 550, 0, 547, 558, 556, 561, 546,
565, 552, 564, 0, 569, 552, 554, 556, 557, 576,
566, 576, 569, 571, 565, 579, 580, 573, 587, 597,
598, 604, 594, 0, 593, 594, 612, 613, 616, 603,
605, 0, 614, 0, 622, 623, 611, 610, 630, 631,
622, 616, 632, 628, 636, 639, 637, 631, 632, 644,
0, 649, 647, 655, 657, 667, 670, 665, 665, 664,
681, 669, 663, 682, 673, 682, 680, 671, 30, 125,
0, 674, 679, 689, 683, 693, 688, 689, 0, 702,
694, 694, 688, 0, 699, 706, 720, 709, 717, 712,
715, 725, 734, 731, 729, 0, 0, 726, 723, 743,
740, 726, 727, 734, 741, 0, 0, 735, 0, 738,
0, 731, 738, 739, 759, 0, 0, 0, 0, 0,
740, 0, 741, 755, 746, 764, 765, 0, 778, 783,
786, 792, 0, 791, 0, 779, 774, 779, 0, 796,
787, 799, 791, 784, 800, 0, 788, 0, 803, 788,
789, 793, 807, 810, 810, 0, 814, 806, 0, 810,
136, 1307, 0, 820, 830, 820, 840, 830, 839, 848,
0, 840, 837, 851, 852, 844, 850, 859, 849, 857,
854, 851, 852, 862, 863, 852, 869, 0, 0, 0,
850, 869, 0, 870, 0, 0, 859, 876, 860, 0,
888, 0, 0, 0, 0, 878, 885, 899, 886, 0,
902, 893, 0, 907, 909, 894, 906, 898, 0, 897,
899, 905, 915, 916, 0, 904, 923, 0, 902, 911,
920, 916, 0, 909, 916, 934, 928, 919, 0, 939,
0, 946, 936, 944, 949, 942, 0, 945, 963, 967,
0, 93, 0, 951, 963, 959, 0, 0, 956, 974,
0, 967, 957, 969, 954, 967, 0, 970, 0, 0,
969, 975, 986, 987, 985, 0, 0, 0, 974, 0,
979, 981, 0, 988, 983, 996, 1002, 1010, 1010, 0,
0, 1015, 0, 0, 1018, 1016, 1008, 1010, 0, 1016,
0, 0, 1019, 1017, 0, 1019, 0, 1031, 1026, 1016,
1023, 1026, 1027, 1036, 0, 1022, 1038, 1032, 1031, 1034,
1031, 1035, 1041, 0, 1038, 1053, 0, 1052, 1066, 0,
1063, 1071, 1076, 1070, 0, 1079, 1071, 1072, 1085, 1082,
0, 1084, 1087, 1081, 1089, 0, 1075, 0, 1090, 1080,
0, 1080, 0, 1081, 1094, 0, 0, 1092, 0, 0,
0, 1087, 1103, 1091, 0, 0, 1102, 0, 0, 1093,
1109, 1105, 0, 0, 1116, 1126, 0, 1126, 1129, 1121,
1136, 1125, 0, 1126, 0, 0, 1307, 1191, 1201, 1211,
1221, 1231, 1235, 1238, 1244, 1252, 1262, 1272, 1282, 1292,
1297, 1299
} ;
static yyconst flex_int16_t yy_def[603] =
{ 0,
588, 588, 587, 3, 589, 589, 590, 590, 591, 591,
592, 592, 587, 587, 587, 593, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 587, 587, 587, 587, 595, 596,
596, 587, 597, 597, 598, 599, 599, 587, 593, 587,
587, 600, 587, 587, 587, 587, 587, 587, 587, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 587,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 587, 587, 595, 596, 587, 597, 587,
587, 587, 587, 587, 587, 587, 587, 587, 601, 599,
587, 600, 587, 587, 587, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 587, 587,
602, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
587, 587, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 594, 594, 594, 594,
594, 594, 594, 594, 594, 594, 0, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587
} ;
static yyconst flex_int16_t yy_nxt[1379] =
{ 0,
587, 587, 15, 15, 61, 61, 155, 155, 67, 62,
62, 68, 67, 587, 70, 68, 70, 73, 73, 77,
78, 155, 155, 70, 587, 70, 174, 174, 587, 175,
175, 155, 155, 269, 270, 270, 270, 175, 175, 175,
175, 361, 270, 587, 16, 16, 17, 18, 19, 18,
20, 21, 22, 23, 22, 24, 25, 26, 26, 17,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
47, 48, 49, 50, 51, 52, 53, 54, 53, 55,
17, 17, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 17, 56, 57,
58, 17, 17, 17, 17, 17, 111, 116, 117, 134,
64, 17, 17, 17, 64, 62, 270, 270, 498, 62,
74, 75, 75, 154, 81, 150, 153, 270, 270, 171,
158, 76, 82, 154, 83, 111, 116, 117, 134, 84,
17, 17, 17, 17, 56, 57, 58, 17, 17, 17,
17, 17, 65, 81, 150, 153, 65, 17, 17, 17,
76, 82, 85, 83, 112, 79, 86, 95, 84, 87,
122, 96, 114, 124, 176, 97, 123, 115, 113, 125,
179, 98, 88, 72, 99, 180, 17, 17, 17, 71,
587, 85, 587, 112, 100, 86, 95, 587, 87, 122,
96, 114, 124, 176, 97, 123, 115, 113, 125, 179,
98, 88, 89, 99, 180, 101, 147, 102, 148, 90,
118, 149, 103, 126, 119, 181, 91, 104, 120, 92,
93, 127, 94, 587, 121, 128, 151, 152, 129, 130,
184, 89, 587, 587, 101, 147, 102, 148, 90, 118,
149, 103, 126, 119, 181, 91, 104, 120, 92, 93,
127, 94, 105, 121, 128, 151, 152, 129, 130, 184,
106, 131, 177, 107, 182, 132, 108, 587, 139, 109,
178, 135, 110, 73, 73, 136, 140, 183, 133, 137,
587, 105, 185, 76, 141, 138, 173, 173, 587, 106,
131, 177, 107, 182, 132, 108, 76, 139, 109, 178,
135, 110, 142, 191, 136, 140, 183, 133, 137, 143,
144, 185, 76, 141, 138, 74, 75, 75, 192, 145,
186, 193, 146, 587, 187, 76, 76, 196, 200, 194,
197, 142, 191, 188, 195, 189, 198, 190, 143, 144,
201, 202, 587, 199, 203, 204, 205, 192, 145, 186,
193, 146, 161, 187, 587, 76, 196, 200, 194, 197,
162, 163, 188, 195, 189, 198, 190, 164, 208, 201,
202, 165, 199, 203, 204, 205, 206, 209, 210, 166,
211, 213, 214, 167, 215, 168, 212, 207, 216, 169,
218, 217, 587, 223, 224, 225, 164, 208, 226, 227,
165, 228, 587, 229, 230, 206, 209, 210, 166, 211,
213, 214, 167, 215, 168, 212, 207, 216, 169, 218,
217, 219, 223, 224, 225, 231, 232, 226, 227, 233,
228, 220, 229, 230, 234, 235, 221, 222, 236, 237,
238, 239, 240, 242, 243, 247, 241, 244, 248, 587,
219, 252, 245, 246, 231, 232, 253, 254, 233, 255,
220, 256, 257, 234, 235, 221, 222, 236, 237, 238,
239, 240, 242, 243, 247, 241, 244, 248, 249, 258,
252, 245, 246, 261, 262, 253, 254, 250, 255, 259,
256, 257, 263, 265, 266, 251, 260, 268, 264, 272,
267, 173, 173, 273, 274, 275, 276, 249, 258, 279,
280, 76, 261, 262, 281, 282, 250, 283, 259, 277,
284, 263, 265, 266, 251, 260, 268, 264, 272, 267,
285, 278, 273, 274, 275, 276, 286, 287, 279, 280,
76, 288, 289, 281, 282, 290, 283, 291, 277, 284,
293, 292, 294, 295, 296, 297, 298, 299, 300, 285,
278, 301, 302, 303, 304, 286, 287, 305, 306, 307,
288, 289, 308, 309, 290, 310, 291, 311, 312, 293,
292, 294, 295, 296, 297, 298, 299, 300, 313, 314,
301, 302, 303, 304, 317, 315, 305, 306, 307, 318,
319, 308, 309, 320, 310, 316, 311, 312, 321, 322,
323, 324, 325, 326, 327, 328, 329, 313, 314, 330,
331, 332, 333, 317, 315, 334, 335, 336, 318, 319,
337, 338, 320, 341, 316, 342, 339, 321, 322, 323,
324, 325, 326, 327, 328, 329, 340, 343, 330, 331,
332, 333, 344, 345, 334, 335, 336, 346, 347, 337,
338, 348, 341, 349, 342, 339, 350, 351, 352, 353,
354, 355, 358, 356, 359, 360, 343, 357, 363, 364,
365, 344, 345, 366, 367, 368, 346, 347, 369, 370,
348, 371, 349, 372, 373, 350, 351, 352, 353, 354,
355, 358, 356, 359, 360, 374, 357, 363, 364, 365,
375, 376, 366, 367, 368, 377, 378, 369, 370, 379,
371, 380, 372, 373, 381, 382, 383, 384, 385, 386,
387, 388, 389, 390, 374, 391, 392, 393, 394, 375,
376, 395, 396, 397, 377, 378, 400, 401, 379, 402,
380, 403, 398, 381, 382, 383, 384, 385, 386, 387,
388, 389, 390, 399, 391, 392, 393, 394, 404, 405,
395, 396, 397, 406, 407, 400, 401, 408, 402, 409,
403, 398, 410, 411, 412, 413, 414, 415, 416, 417,
418, 419, 399, 420, 421, 422, 423, 404, 405, 424,
425, 426, 406, 407, 427, 428, 408, 429, 409, 430,
431, 410, 411, 412, 413, 414, 415, 416, 417, 418,
419, 432, 420, 421, 422, 423, 433, 434, 424, 425,
426, 437, 435, 427, 428, 436, 429, 438, 430, 431,
439, 440, 441, 442, 443, 444, 445, 446, 447, 448,
432, 449, 450, 451, 452, 433, 434, 453, 454, 455,
437, 435, 456, 457, 436, 458, 438, 459, 460, 439,
440, 441, 442, 443, 444, 445, 446, 447, 448, 461,
449, 450, 451, 452, 462, 463, 453, 454, 455, 464,
465, 456, 457, 466, 458, 467, 459, 460, 468, 469,
470, 471, 472, 473, 474, 475, 476, 477, 461, 478,
479, 480, 481, 462, 463, 482, 483, 484, 464, 465,
485, 486, 466, 487, 467, 488, 489, 468, 469, 470,
471, 472, 473, 474, 475, 476, 477, 490, 478, 479,
480, 481, 491, 492, 482, 483, 484, 493, 494, 485,
486, 495, 487, 496, 488, 489, 497, 499, 500, 501,
502, 503, 504, 505, 506, 507, 490, 508, 509, 510,
511, 491, 492, 512, 513, 514, 493, 494, 515, 516,
495, 517, 496, 518, 519, 497, 499, 500, 501, 502,
503, 504, 505, 506, 507, 520, 508, 509, 510, 511,
521, 522, 512, 513, 514, 523, 524, 515, 516, 525,
517, 526, 518, 519, 527, 528, 529, 530, 531, 532,
533, 534, 535, 536, 520, 537, 538, 539, 540, 521,
522, 541, 542, 543, 523, 524, 544, 545, 525, 546,
526, 547, 548, 527, 528, 529, 530, 531, 532, 533,
534, 535, 536, 549, 537, 538, 539, 540, 550, 551,
541, 542, 543, 552, 553, 544, 545, 554, 546, 555,
547, 548, 556, 557, 558, 559, 560, 561, 562, 563,
564, 565, 549, 566, 567, 568, 569, 550, 551, 570,
571, 572, 552, 553, 573, 574, 554, 575, 555, 576,
577, 556, 557, 558, 559, 560, 561, 562, 563, 564,
565, 578, 566, 567, 568, 569, 579, 580, 570, 571,
572, 581, 582, 573, 574, 583, 575, 584, 576, 577,
585, 586, 587, 587, 587, 587, 587, 587, 587, 587,
578, 587, 587, 587, 587, 579, 580, 587, 587, 587,
581, 582, 587, 587, 583, 587, 584, 587, 587, 585,
586, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 63, 63, 63, 63, 63, 63, 63, 63, 63,
63, 66, 66, 66, 66, 66, 66, 66, 66, 66,
66, 69, 69, 80, 80, 80, 587, 80, 156, 156,
156, 156, 157, 157, 157, 587, 157, 157, 157, 157,
157, 157, 159, 159, 159, 587, 159, 159, 159, 159,
587, 159, 160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 170, 170, 587, 170, 170, 170, 170, 170,
170, 170, 172, 587, 172, 172, 172, 172, 172, 172,
172, 172, 271, 271, 362, 362, 13, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587
} ;
static yyconst flex_int16_t yy_chk[1379] =
{ 0,
0, 0, 1, 2, 7, 8, 57, 57, 11, 7,
8, 11, 12, 0, 18, 12, 18, 25, 25, 27,
27, 58, 58, 70, 0, 70, 76, 76, 0, 76,
76, 155, 155, 162, 162, 163, 163, 174, 174, 175,
175, 269, 269, 0, 1, 2, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 5, 5, 5,
5, 5, 5, 5, 5, 5, 36, 39, 40, 46,
9, 5, 5, 5, 10, 9, 270, 270, 452, 10,
26, 26, 26, 154, 30, 51, 54, 361, 361, 68,
62, 26, 30, 56, 30, 36, 39, 40, 46, 30,
5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
6, 6, 9, 30, 51, 54, 10, 6, 6, 6,
26, 30, 31, 30, 37, 29, 31, 33, 30, 31,
42, 33, 38, 43, 81, 33, 42, 38, 37, 43,
83, 33, 31, 24, 33, 84, 6, 6, 6, 20,
13, 31, 0, 37, 34, 31, 33, 0, 31, 42,
33, 38, 43, 81, 33, 42, 38, 37, 43, 83,
33, 31, 32, 33, 84, 34, 50, 34, 50, 32,
41, 50, 34, 44, 41, 85, 32, 34, 41, 32,
32, 44, 32, 0, 41, 44, 52, 52, 44, 44,
87, 32, 0, 0, 34, 50, 34, 50, 32, 41,
50, 34, 44, 41, 85, 32, 34, 41, 32, 32,
44, 32, 35, 41, 44, 52, 52, 44, 44, 87,
35, 45, 82, 35, 86, 45, 35, 0, 48, 35,
82, 47, 35, 73, 73, 47, 48, 86, 45, 47,
0, 35, 89, 73, 48, 47, 74, 74, 0, 35,
45, 82, 35, 86, 45, 35, 74, 48, 35, 82,
47, 35, 49, 92, 47, 48, 86, 45, 47, 49,
49, 89, 73, 48, 47, 75, 75, 75, 93, 49,
90, 94, 49, 0, 90, 74, 75, 96, 97, 95,
96, 49, 92, 91, 95, 91, 96, 91, 49, 49,
98, 99, 0, 96, 101, 102, 103, 93, 49, 90,
94, 49, 65, 90, 0, 75, 96, 97, 95, 96,
65, 65, 91, 95, 91, 96, 91, 65, 105, 98,
99, 65, 96, 101, 102, 103, 104, 106, 107, 65,
108, 109, 110, 65, 111, 65, 108, 104, 112, 65,
113, 112, 0, 116, 117, 118, 65, 105, 119, 120,
65, 120, 0, 121, 122, 104, 106, 107, 65, 108,
109, 110, 65, 111, 65, 108, 104, 112, 65, 113,
112, 114, 116, 117, 118, 123, 124, 119, 120, 125,
120, 114, 121, 122, 126, 128, 114, 114, 129, 130,
131, 132, 133, 134, 135, 137, 133, 136, 138, 0,
114, 140, 136, 136, 123, 124, 141, 142, 125, 143,
114, 144, 145, 126, 128, 114, 114, 129, 130, 131,
132, 133, 134, 135, 137, 133, 136, 138, 139, 146,
140, 136, 136, 148, 149, 141, 142, 139, 143, 147,
144, 145, 150, 151, 152, 139, 147, 153, 150, 178,
152, 173, 173, 180, 181, 182, 183, 139, 146, 185,
186, 173, 148, 149, 187, 188, 139, 189, 147, 184,
190, 150, 151, 152, 139, 147, 153, 150, 178, 152,
191, 184, 180, 181, 182, 183, 192, 193, 185, 186,
173, 194, 196, 187, 188, 197, 189, 198, 184, 190,
199, 198, 200, 201, 202, 203, 205, 206, 207, 191,
184, 208, 209, 210, 211, 192, 193, 212, 213, 214,
194, 196, 215, 216, 197, 217, 198, 218, 219, 199,
198, 200, 201, 202, 203, 205, 206, 207, 220, 221,
208, 209, 210, 211, 223, 222, 212, 213, 214, 225,
226, 215, 216, 227, 217, 222, 218, 219, 228, 229,
230, 231, 233, 235, 236, 237, 238, 220, 221, 239,
240, 241, 242, 223, 222, 243, 244, 245, 225, 226,
246, 247, 227, 249, 222, 250, 248, 228, 229, 230,
231, 233, 235, 236, 237, 238, 248, 252, 239, 240,
241, 242, 253, 254, 243, 244, 245, 255, 256, 246,
247, 257, 249, 258, 250, 248, 259, 260, 261, 262,
263, 264, 266, 265, 267, 268, 252, 265, 272, 273,
274, 253, 254, 275, 276, 277, 255, 256, 278, 280,
257, 281, 258, 282, 283, 259, 260, 261, 262, 263,
264, 266, 265, 267, 268, 285, 265, 272, 273, 274,
286, 287, 275, 276, 277, 288, 289, 278, 280, 290,
281, 291, 282, 283, 292, 293, 294, 295, 298, 299,
300, 301, 302, 303, 285, 304, 305, 308, 310, 286,
287, 312, 313, 314, 288, 289, 321, 323, 290, 324,
291, 325, 315, 292, 293, 294, 295, 298, 299, 300,
301, 302, 303, 315, 304, 305, 308, 310, 326, 327,
312, 313, 314, 329, 330, 321, 323, 331, 324, 332,
325, 315, 334, 336, 337, 338, 340, 341, 342, 343,
344, 345, 315, 347, 349, 350, 351, 326, 327, 352,
353, 354, 329, 330, 355, 357, 331, 358, 332, 360,
364, 334, 336, 337, 338, 340, 341, 342, 343, 344,
345, 365, 347, 349, 350, 351, 366, 367, 352, 353,
354, 369, 368, 355, 357, 368, 358, 370, 360, 364,
372, 373, 374, 375, 376, 377, 378, 379, 380, 381,
365, 382, 383, 384, 385, 366, 367, 386, 387, 391,
369, 368, 392, 394, 368, 397, 370, 398, 399, 372,
373, 374, 375, 376, 377, 378, 379, 380, 381, 401,
382, 383, 384, 385, 406, 407, 386, 387, 391, 408,
409, 392, 394, 411, 397, 412, 398, 399, 414, 415,
416, 417, 418, 420, 421, 422, 423, 424, 401, 426,
427, 429, 430, 406, 407, 431, 432, 434, 408, 409,
435, 436, 411, 437, 412, 438, 440, 414, 415, 416,
417, 418, 420, 421, 422, 423, 424, 442, 426, 427,
429, 430, 443, 444, 431, 432, 434, 445, 446, 435,
436, 448, 437, 449, 438, 440, 450, 454, 455, 456,
459, 460, 462, 463, 464, 465, 442, 466, 468, 471,
472, 443, 444, 473, 474, 475, 445, 446, 479, 481,
448, 482, 449, 484, 485, 450, 454, 455, 456, 459,
460, 462, 463, 464, 465, 486, 466, 468, 471, 472,
487, 488, 473, 474, 475, 489, 492, 479, 481, 495,
482, 496, 484, 485, 497, 498, 500, 503, 504, 506,
508, 509, 510, 511, 486, 512, 513, 514, 516, 487,
488, 517, 518, 519, 489, 492, 520, 521, 495, 522,
496, 523, 525, 497, 498, 500, 503, 504, 506, 508,
509, 510, 511, 526, 512, 513, 514, 516, 528, 529,
517, 518, 519, 531, 532, 520, 521, 533, 522, 534,
523, 525, 536, 537, 538, 539, 540, 542, 543, 544,
545, 547, 526, 549, 550, 552, 554, 528, 529, 555,
558, 562, 531, 532, 563, 564, 533, 567, 534, 570,
571, 536, 537, 538, 539, 540, 542, 543, 544, 545,
547, 572, 549, 550, 552, 554, 575, 576, 555, 558,
562, 578, 579, 563, 564, 580, 567, 581, 570, 571,
582, 584, 0, 0, 0, 0, 0, 0, 0, 0,
572, 0, 0, 0, 0, 575, 576, 0, 0, 0,
578, 579, 0, 0, 580, 0, 581, 0, 0, 582,
584, 588, 588, 588, 588, 588, 588, 588, 588, 588,
588, 589, 589, 589, 589, 589, 589, 589, 589, 589,
589, 590, 590, 590, 590, 590, 590, 590, 590, 590,
590, 591, 591, 591, 591, 591, 591, 591, 591, 591,
591, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 593, 593, 594, 594, 594, 0, 594, 595, 595,
595, 595, 596, 596, 596, 0, 596, 596, 596, 596,
596, 596, 597, 597, 597, 0, 597, 597, 597, 597,
0, 597, 598, 598, 598, 598, 598, 598, 598, 598,
598, 598, 599, 599, 0, 599, 599, 599, 599, 599,
599, 599, 600, 0, 600, 600, 600, 600, 600, 600,
600, 600, 601, 601, 602, 602, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 587, 587, 587, 587, 587, 587
} ;
/* Table of booleans, true if rule could match eol. */
static yyconst flex_int32_t yy_rule_can_match_eol[161] =
{ 0,
0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0,
0, };
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
*/
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
#line 1 "../SqlLexer.lpp"
/**
* Copyright 2011-2015 Quickstep Technologies LLC.
* Copyright 2015 Pivotal Software, Inc.
* Copyright 2016, Quickstep Research Group, Computer Sciences Department,
* University of Wisconsin—Madison.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
#define YY_NO_INPUT 1
#define YY_NO_UNISTD_H 1
#line 29 "../SqlLexer.lpp"
#include <cstdio>
#include <string>
#include <vector>
#include "parser/ParseJoinedTableReference.hpp"
#include "parser/ParseLiteralValue.hpp"
#include "utility/PtrList.hpp"
#include "utility/PtrVector.hpp"
namespace quickstep {
class BinaryOperation;
class Comparison;
class ParseAssignment;
class ParseAttribute;
class ParseAttributeDefinition;
class ParseBlockProperties;
class ParseColumnConstraint;
class ParseCommand;
struct ParseCopyFromParams;
class ParseDataType;
class ParseExpression;
struct ParseFrameInfo;
class ParseFunctionCall;
class ParseGroupBy;
class ParseHaving;
class ParseKeyIntegerValue;
class ParseKeyStringValue;
class ParseKeyStringList;
class ParseKeyValue;
class ParseLimit;
class ParseOrderBy;
class ParseOrderByItem;
class ParsePartitionClause;
class ParsePredicate;
class ParseSample;
class ParseScalarLiteral;
class ParseSearchedWhenClause;
class ParseSelect;
class ParseSelectionClause;
class ParseSelectionItem;
class ParseSelectionItemScalar;
class ParseSelectionList;
class ParseSimpleTableReference;
class ParseSimpleWhenClause;
class ParseStringKeyLiteralValues;
class ParseStatement;
class ParseStatementCopyFrom;
class ParseStatementCreateTable;
class ParseStatementDelete;
class ParseStatementDropTable;
class ParseStatementInsert;
class ParseStatementInsertTuple;
class ParseStatementInsertSelection;
class ParseStatementSelect;
class ParseStatementQuit;
class ParseStatementUpdate;
class ParseSubqueryExpression;
class ParseSubqueryTableReference;
class ParseTableReference;
class ParseTableReferenceSignature;
class ParseWindow;
class Type;
class UnaryOperation;
} // namespace quickstep
#include "parser/ParseString.hpp"
#include "parser/SqlParser_gen.hpp"
#include "parser/ParserUtil.hpp"
#define YY_USER_ACTION \
{ \
yylloc->first_line = yylineno; \
yylloc->first_column = yycolumn; \
yycolumn += yyleng; \
}
/* FIXME(chasseur, qzeng): Add support for hexadecimal literals. */
/**
* These patterns are based on the SQL-2011 standard for syntax of numeric
* literals (Part 2, Section 5.3 of the standard).
**/
#line 1085 "SqlLexer_gen.cpp"
#define INITIAL 0
#define CONDITION_SQL 1
#define CONDITION_COMMAND 2
#define CONDITION_STRING_SINGLE_QUOTED 3
#define CONDITION_STRING_SINGLE_QUOTED_ESCAPED 4
#define CONDITION_STRING_DOUBLE_QUOTED 5
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
* down here because we want the user's section 1 to have been scanned first.
* The user has a chance to override it with an option.
*/
#include <unistd.h>
#endif
#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif
/* Holds the entire state of the reentrant scanner. */
struct yyguts_t
{
/* User-defined. Not touched by flex. */
YY_EXTRA_TYPE yyextra_r;
/* The rest are the same as the globals declared in the non-reentrant scanner. */
FILE *yyin_r, *yyout_r;
size_t yy_buffer_stack_top; /**< index of top of stack. */
size_t yy_buffer_stack_max; /**< capacity of stack. */
YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
char yy_hold_char;
yy_size_t yy_n_chars;
yy_size_t yyleng_r;
char *yy_c_buf_p;
int yy_init;
int yy_start;
int yy_did_buffer_switch_on_eof;
int yy_start_stack_ptr;
int yy_start_stack_depth;
int *yy_start_stack;
yy_state_type yy_last_accepting_state;
char* yy_last_accepting_cpos;
int yylineno_r;
int yy_flex_debug_r;
char *yytext_r;
int yy_more_flag;
int yy_more_len;
YYSTYPE * yylval_r;
YYLTYPE * yylloc_r;
}; /* end struct yyguts_t */
static int yy_init_globals (yyscan_t yyscanner );
/* This must go here because YYSTYPE and YYLTYPE are included
* from bison output in section 1.*/
# define yylval yyg->yylval_r
# define yylloc yyg->yylloc_r
int quickstep_yylex_init (yyscan_t* scanner);
int quickstep_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int quickstep_yylex_destroy (yyscan_t yyscanner );
int quickstep_yyget_debug (yyscan_t yyscanner );
void quickstep_yyset_debug (int debug_flag ,yyscan_t yyscanner );
YY_EXTRA_TYPE quickstep_yyget_extra (yyscan_t yyscanner );
void quickstep_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
FILE *quickstep_yyget_in (yyscan_t yyscanner );
void quickstep_yyset_in (FILE * in_str ,yyscan_t yyscanner );
FILE *quickstep_yyget_out (yyscan_t yyscanner );
void quickstep_yyset_out (FILE * out_str ,yyscan_t yyscanner );
yy_size_t quickstep_yyget_leng (yyscan_t yyscanner );
char *quickstep_yyget_text (yyscan_t yyscanner );
int quickstep_yyget_lineno (yyscan_t yyscanner );
void quickstep_yyset_lineno (int line_number ,yyscan_t yyscanner );
int quickstep_yyget_column (yyscan_t yyscanner );
void quickstep_yyset_column (int column_no ,yyscan_t yyscanner );
YYSTYPE * quickstep_yyget_lval (yyscan_t yyscanner );
void quickstep_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
YYLTYPE *quickstep_yyget_lloc (yyscan_t yyscanner );
void quickstep_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int quickstep_yywrap (yyscan_t yyscanner );
#else
extern int quickstep_yywrap (yyscan_t yyscanner );
#endif
#endif
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (yyscan_t yyscanner );
#else
static int input (yyscan_t yyscanner );
#endif
#endif
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
* is returned in "result".
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
size_t n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
if ( c == EOF && ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else \
{ \
errno=0; \
while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
break; \
} \
errno=0; \
clearerr(yyin); \
} \
}\
\
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
* we don't want an extra ';' after the "return" because that will cause
* some compilers to complain about unreachable statements.
*/
#ifndef yyterminate
#define yyterminate() return YY_NULL
#endif
/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif
/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
#endif
/* end tables serialization structures and prototypes */
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
extern int quickstep_yylex \
(YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
#define YY_DECL int quickstep_yylex \
(YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after yytext and yyleng
* have been set up.
*/
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK break;
#endif
#define YY_RULE_SETUP \
YY_USER_ACTION
/** The main scanner function which does all the work.
*/
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yylval = yylval_param;
yylloc = yylloc_param;
if ( !yyg->yy_init )
{
yyg->yy_init = 1;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
if ( ! yyg->yy_start )
yyg->yy_start = 1; /* first start state */
if ( ! yyin )
yyin = stdin;
if ( ! yyout )
yyout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
quickstep_yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
quickstep_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
}
quickstep_yy_load_buffer_state(yyscanner );
}
{
#line 130 "../SqlLexer.lpp"
#line 1372 "SqlLexer_gen.cpp"
while ( 1 ) /* loops until end-of-file is reached */
{
yy_cp = yyg->yy_c_buf_p;
/* Support of yytext. */
*yy_cp = yyg->yy_hold_char;
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
*/
yy_bp = yy_cp;
yy_current_state = yyg->yy_start;
yy_match:
do
{
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
yyg->yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 588 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_current_state != 587 );
yy_cp = yyg->yy_last_accepting_cpos;
yy_current_state = yyg->yy_last_accepting_state;
yy_find_action:
yy_act = yy_accept[yy_current_state];
YY_DO_BEFORE_ACTION;
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{
yy_size_t yyl;
for ( yyl = 0; yyl < yyleng; ++yyl )
if ( yytext[yyl] == '\n' )
do{ yylineno++;
yycolumn=0;
}while(0)
;
}
do_action: /* This label is used only to access EOF actions. */
switch ( yy_act )
{ /* beginning of action switch */
case 0: /* must back up */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = yyg->yy_hold_char;
yy_cp = yyg->yy_last_accepting_cpos;
yy_current_state = yyg->yy_last_accepting_state;
goto yy_find_action;
case 1:
YY_RULE_SETUP
#line 133 "../SqlLexer.lpp"
{
/* A forward slash character represents a system command. */
BEGIN(CONDITION_COMMAND);
yylval->string_value_ = new quickstep::ParseString(
yylloc->first_line, yylloc->first_column, std::string(yytext, yyleng));
return TOKEN_COMMAND;
}
YY_BREAK
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
#line 141 "../SqlLexer.lpp"
{
/* This is a SQL command. Place the char back and process normally. */
yyless(0);
yycolumn--;
BEGIN(CONDITION_SQL);
}
YY_BREAK
case 3:
YY_RULE_SETUP
#line 150 "../SqlLexer.lpp"
{
/* This is a command argument. */
yylval->string_value_ = new quickstep::ParseString(
yylloc->first_line, yylloc->first_column, std::string(yytext, yyleng));
return TOKEN_COMMAND;
}
YY_BREAK
case 4:
YY_RULE_SETUP
#line 157 "../SqlLexer.lpp"
{
/* Ignore whitespace. */
}
YY_BREAK
case 5:
/* rule 5 can match eol */
YY_RULE_SETUP
#line 161 "../SqlLexer.lpp"
{
/* Newline reverts the lexer to the initial state. */
yycolumn = 0;
BEGIN(INITIAL);
return '\n';
}
YY_BREAK
case 6:
YY_RULE_SETUP
#line 170 "../SqlLexer.lpp"
return TOKEN_ADD;
YY_BREAK
case 7:
YY_RULE_SETUP
#line 171 "../SqlLexer.lpp"
return TOKEN_ALL;
YY_BREAK
case 8:
YY_RULE_SETUP
#line 172 "../SqlLexer.lpp"
return TOKEN_ALTER;
YY_BREAK
case 9:
YY_RULE_SETUP
#line 173 "../SqlLexer.lpp"
return TOKEN_AND;
YY_BREAK
case 10:
YY_RULE_SETUP
#line 174 "../SqlLexer.lpp"
return TOKEN_AS;
YY_BREAK
case 11:
YY_RULE_SETUP
#line 175 "../SqlLexer.lpp"
return TOKEN_ASC;
YY_BREAK
case 12:
YY_RULE_SETUP
#line 176 "../SqlLexer.lpp"
return TOKEN_ASC;
YY_BREAK
case 13:
YY_RULE_SETUP
#line 177 "../SqlLexer.lpp"
return TOKEN_BETWEEN;
YY_BREAK
case 14:
YY_RULE_SETUP
#line 178 "../SqlLexer.lpp"
return TOKEN_BIGINT;
YY_BREAK
case 15:
YY_RULE_SETUP
#line 179 "../SqlLexer.lpp"
return TOKEN_BIT;
YY_BREAK
case 16:
YY_RULE_SETUP
#line 180 "../SqlLexer.lpp"
return TOKEN_BITWEAVING;
YY_BREAK
case 17:
YY_RULE_SETUP
#line 181 "../SqlLexer.lpp"
return TOKEN_BLOCKPROPERTIES;
YY_BREAK
case 18:
YY_RULE_SETUP
#line 182 "../SqlLexer.lpp"
return TOKEN_BLOCKSAMPLE;
YY_BREAK
case 19:
YY_RULE_SETUP
#line 183 "../SqlLexer.lpp"
return TOKEN_BLOOM_FILTER;
YY_BREAK
case 20:
YY_RULE_SETUP
#line 184 "../SqlLexer.lpp"
return TOKEN_CASE;
YY_BREAK
case 21:
YY_RULE_SETUP
#line 185 "../SqlLexer.lpp"
return TOKEN_CSB_TREE;
YY_BREAK
case 22:
YY_RULE_SETUP
#line 186 "../SqlLexer.lpp"
return TOKEN_BY;
YY_BREAK
case 23:
YY_RULE_SETUP
#line 187 "../SqlLexer.lpp"
return TOKEN_CHARACTER;
YY_BREAK
case 24:
YY_RULE_SETUP
#line 188 "../SqlLexer.lpp"
return TOKEN_CHARACTER;
YY_BREAK
case 25:
YY_RULE_SETUP
#line 189 "../SqlLexer.lpp"
return TOKEN_CHECK;
YY_BREAK
case 26:
YY_RULE_SETUP
#line 190 "../SqlLexer.lpp"
return TOKEN_COLUMN;
YY_BREAK
case 27:
YY_RULE_SETUP
#line 191 "../SqlLexer.lpp"
return TOKEN_CONSTRAINT;
YY_BREAK
case 28:
YY_RULE_SETUP
#line 192 "../SqlLexer.lpp"
return TOKEN_COPY;
YY_BREAK
case 29:
YY_RULE_SETUP
#line 193 "../SqlLexer.lpp"
return TOKEN_CREATE;
YY_BREAK
case 30:
YY_RULE_SETUP
#line 194 "../SqlLexer.lpp"
return TOKEN_CURRENT;
YY_BREAK
case 31:
YY_RULE_SETUP
#line 195 "../SqlLexer.lpp"
return TOKEN_DATE;
YY_BREAK
case 32:
YY_RULE_SETUP
#line 196 "../SqlLexer.lpp"
return TOKEN_DATETIME;
YY_BREAK
case 33:
YY_RULE_SETUP
#line 197 "../SqlLexer.lpp"
return TOKEN_DAY;
YY_BREAK
case 34:
YY_RULE_SETUP
#line 198 "../SqlLexer.lpp"
return TOKEN_DECIMAL;
YY_BREAK
case 35:
YY_RULE_SETUP
#line 199 "../SqlLexer.lpp"
return TOKEN_DEFAULT;
YY_BREAK
case 36:
YY_RULE_SETUP
#line 200 "../SqlLexer.lpp"
return TOKEN_DELETE;
YY_BREAK
case 37:
YY_RULE_SETUP
#line 201 "../SqlLexer.lpp"
return TOKEN_DELIMITER;
YY_BREAK
case 38:
YY_RULE_SETUP
#line 202 "../SqlLexer.lpp"
return TOKEN_DESC;
YY_BREAK
case 39:
YY_RULE_SETUP
#line 203 "../SqlLexer.lpp"
return TOKEN_DESC;
YY_BREAK
case 40:
YY_RULE_SETUP
#line 204 "../SqlLexer.lpp"
return TOKEN_DISTINCT;
YY_BREAK
case 41:
YY_RULE_SETUP
#line 205 "../SqlLexer.lpp"
return TOKEN_DOUBLE;
YY_BREAK
case 42:
YY_RULE_SETUP
#line 206 "../SqlLexer.lpp"
return TOKEN_DROP;
YY_BREAK
case 43:
YY_RULE_SETUP
#line 207 "../SqlLexer.lpp"
return TOKEN_ELSE;
YY_BREAK
case 44:
YY_RULE_SETUP
#line 208 "../SqlLexer.lpp"
return TOKEN_END;
YY_BREAK
case 45:
YY_RULE_SETUP
#line 209 "../SqlLexer.lpp"
return TOKEN_ESCAPE_STRINGS;
YY_BREAK
case 46:
YY_RULE_SETUP
#line 210 "../SqlLexer.lpp"
return TOKEN_EXISTS;
YY_BREAK
case 47:
YY_RULE_SETUP
#line 211 "../SqlLexer.lpp"
return TOKEN_EXTRACT;
YY_BREAK
case 48:
YY_RULE_SETUP
#line 212 "../SqlLexer.lpp"
return TOKEN_FALSE;
YY_BREAK
case 49:
YY_RULE_SETUP
#line 213 "../SqlLexer.lpp"
return TOKEN_FIRST;
YY_BREAK
case 50:
YY_RULE_SETUP
#line 214 "../SqlLexer.lpp"
return TOKEN_FLOAT;
YY_BREAK
case 51:
YY_RULE_SETUP
#line 215 "../SqlLexer.lpp"
return TOKEN_FOLLOWING;
YY_BREAK
case 52:
YY_RULE_SETUP
#line 216 "../SqlLexer.lpp"
return TOKEN_FOR;
YY_BREAK
case 53:
YY_RULE_SETUP
#line 217 "../SqlLexer.lpp"
return TOKEN_FOREIGN;
YY_BREAK
case 54:
YY_RULE_SETUP
#line 218 "../SqlLexer.lpp"
return TOKEN_FROM;
YY_BREAK
case 55:
YY_RULE_SETUP
#line 219 "../SqlLexer.lpp"
return TOKEN_FULL;
YY_BREAK
case 56:
YY_RULE_SETUP
#line 220 "../SqlLexer.lpp"
return TOKEN_GROUP;
YY_BREAK
case 57:
YY_RULE_SETUP
#line 221 "../SqlLexer.lpp"
return TOKEN_HASH;
YY_BREAK
case 58:
YY_RULE_SETUP
#line 222 "../SqlLexer.lpp"
return TOKEN_HAVING;
YY_BREAK
case 59:
YY_RULE_SETUP
#line 223 "../SqlLexer.lpp"
return TOKEN_HOUR;
YY_BREAK
case 60:
YY_RULE_SETUP
#line 224 "../SqlLexer.lpp"
return TOKEN_IN;
YY_BREAK
case 61:
YY_RULE_SETUP
#line 225 "../SqlLexer.lpp"
return TOKEN_INDEX;
YY_BREAK
case 62:
YY_RULE_SETUP
#line 226 "../SqlLexer.lpp"
return TOKEN_INNER;
YY_BREAK
case 63:
YY_RULE_SETUP
#line 227 "../SqlLexer.lpp"
return TOKEN_INSERT;
YY_BREAK
case 64:
YY_RULE_SETUP
#line 228 "../SqlLexer.lpp"
return TOKEN_INTEGER;
YY_BREAK
case 65:
YY_RULE_SETUP
#line 229 "../SqlLexer.lpp"
return TOKEN_INTEGER;
YY_BREAK
case 66:
YY_RULE_SETUP
#line 230 "../SqlLexer.lpp"
return TOKEN_INTERVAL;
YY_BREAK
case 67:
YY_RULE_SETUP
#line 231 "../SqlLexer.lpp"
return TOKEN_INTO;
YY_BREAK
case 68:
YY_RULE_SETUP
#line 232 "../SqlLexer.lpp"
return TOKEN_IS;
YY_BREAK
case 69:
YY_RULE_SETUP
#line 233 "../SqlLexer.lpp"
return TOKEN_JOIN;
YY_BREAK
case 70:
YY_RULE_SETUP
#line 234 "../SqlLexer.lpp"
return TOKEN_KEY;
YY_BREAK
case 71:
YY_RULE_SETUP
#line 235 "../SqlLexer.lpp"
return TOKEN_LAST;
YY_BREAK
case 72:
YY_RULE_SETUP
#line 236 "../SqlLexer.lpp"
return TOKEN_LEFT;
YY_BREAK
case 73:
YY_RULE_SETUP
#line 237 "../SqlLexer.lpp"
return TOKEN_LIKE;
YY_BREAK
case 74:
YY_RULE_SETUP
#line 238 "../SqlLexer.lpp"
return TOKEN_LIMIT;
YY_BREAK
case 75:
YY_RULE_SETUP
#line 239 "../SqlLexer.lpp"
return TOKEN_LONG;
YY_BREAK
case 76:
YY_RULE_SETUP
#line 240 "../SqlLexer.lpp"
return TOKEN_MINUTE;
YY_BREAK
case 77:
YY_RULE_SETUP
#line 241 "../SqlLexer.lpp"
return TOKEN_MONTH;
YY_BREAK
case 78:
YY_RULE_SETUP
#line 242 "../SqlLexer.lpp"
return TOKEN_NOT;
YY_BREAK
case 79:
YY_RULE_SETUP
#line 243 "../SqlLexer.lpp"
return TOKEN_NULL;
YY_BREAK
case 80:
YY_RULE_SETUP
#line 244 "../SqlLexer.lpp"
return TOKEN_NULLS;
YY_BREAK
case 81:
YY_RULE_SETUP
#line 245 "../SqlLexer.lpp"
return TOKEN_OFF;
YY_BREAK
case 82:
YY_RULE_SETUP
#line 246 "../SqlLexer.lpp"
return TOKEN_ON;
YY_BREAK
case 83:
YY_RULE_SETUP
#line 247 "../SqlLexer.lpp"
return TOKEN_OR;
YY_BREAK
case 84:
YY_RULE_SETUP
#line 248 "../SqlLexer.lpp"
return TOKEN_ORDER;
YY_BREAK
case 85:
YY_RULE_SETUP
#line 249 "../SqlLexer.lpp"
return TOKEN_OUTER;
YY_BREAK
case 86:
YY_RULE_SETUP
#line 250 "../SqlLexer.lpp"
return TOKEN_OVER;
YY_BREAK
case 87:
YY_RULE_SETUP
#line 251 "../SqlLexer.lpp"
return TOKEN_PARTITION;
YY_BREAK
case 88:
YY_RULE_SETUP
#line 252 "../SqlLexer.lpp"
return TOKEN_PARTITIONS;
YY_BREAK
case 89:
YY_RULE_SETUP
#line 253 "../SqlLexer.lpp"
return TOKEN_PERCENT;
YY_BREAK
case 90:
YY_RULE_SETUP
#line 254 "../SqlLexer.lpp"
return TOKEN_PRECEDING;
YY_BREAK
case 91:
YY_RULE_SETUP
#line 255 "../SqlLexer.lpp"
return TOKEN_PRIMARY;
YY_BREAK
case 92:
YY_RULE_SETUP
#line 256 "../SqlLexer.lpp"
return TOKEN_QUIT;
YY_BREAK
case 93:
YY_RULE_SETUP
#line 257 "../SqlLexer.lpp"
return TOKEN_RANGE;
YY_BREAK
case 94:
YY_RULE_SETUP
#line 258 "../SqlLexer.lpp"
return TOKEN_REAL;
YY_BREAK
case 95:
YY_RULE_SETUP
#line 259 "../SqlLexer.lpp"
return TOKEN_REFERENCES;
YY_BREAK
case 96:
YY_RULE_SETUP
#line 260 "../SqlLexer.lpp"
return TOKEN_REGEXP;
YY_BREAK
case 97:
YY_RULE_SETUP
#line 261 "../SqlLexer.lpp"
return TOKEN_RIGHT;
YY_BREAK
case 98:
YY_RULE_SETUP
#line 262 "../SqlLexer.lpp"
return TOKEN_ROW;
YY_BREAK
case 99:
YY_RULE_SETUP
#line 263 "../SqlLexer.lpp"
return TOKEN_ROW_DELIMITER;
YY_BREAK
case 100:
YY_RULE_SETUP
#line 264 "../SqlLexer.lpp"
return TOKEN_ROWS;
YY_BREAK
case 101:
YY_RULE_SETUP
#line 265 "../SqlLexer.lpp"
return TOKEN_SECOND;
YY_BREAK
case 102:
YY_RULE_SETUP
#line 266 "../SqlLexer.lpp"
return TOKEN_SELECT;
YY_BREAK
case 103:
YY_RULE_SETUP
#line 267 "../SqlLexer.lpp"
return TOKEN_SET;
YY_BREAK
case 104:
YY_RULE_SETUP
#line 268 "../SqlLexer.lpp"
return TOKEN_SMA;
YY_BREAK
case 105:
YY_RULE_SETUP
#line 269 "../SqlLexer.lpp"
return TOKEN_SMALLINT;
YY_BREAK
case 106:
YY_RULE_SETUP
#line 270 "../SqlLexer.lpp"
return TOKEN_SUBSTRING;
YY_BREAK
case 107:
YY_RULE_SETUP
#line 271 "../SqlLexer.lpp"
return TOKEN_TABLE;
YY_BREAK
case 108:
YY_RULE_SETUP
#line 272 "../SqlLexer.lpp"
return TOKEN_THEN;
YY_BREAK
case 109:
YY_RULE_SETUP
#line 273 "../SqlLexer.lpp"
return TOKEN_TIME;
YY_BREAK
case 110:
YY_RULE_SETUP
#line 274 "../SqlLexer.lpp"
return TOKEN_TIMESTAMP;
YY_BREAK
case 111:
YY_RULE_SETUP
#line 275 "../SqlLexer.lpp"
return TOKEN_TRUE;
YY_BREAK
case 112:
YY_RULE_SETUP
#line 276 "../SqlLexer.lpp"
return TOKEN_TUPLESAMPLE;
YY_BREAK
case 113:
YY_RULE_SETUP
#line 277 "../SqlLexer.lpp"
return TOKEN_UNBOUNDED;
YY_BREAK
case 114:
YY_RULE_SETUP
#line 278 "../SqlLexer.lpp"
return TOKEN_UNIQUE;
YY_BREAK
case 115:
YY_RULE_SETUP
#line 279 "../SqlLexer.lpp"
return TOKEN_UPDATE;
YY_BREAK
case 116:
YY_RULE_SETUP
#line 280 "../SqlLexer.lpp"
return TOKEN_USING;
YY_BREAK
case 117:
YY_RULE_SETUP
#line 281 "../SqlLexer.lpp"
return TOKEN_VALUES;
YY_BREAK
case 118:
YY_RULE_SETUP
#line 282 "../SqlLexer.lpp"
return TOKEN_VARCHAR;
YY_BREAK
case 119:
YY_RULE_SETUP
#line 283 "../SqlLexer.lpp"
return TOKEN_WHEN;
YY_BREAK
case 120:
YY_RULE_SETUP
#line 284 "../SqlLexer.lpp"
return TOKEN_WHERE;
YY_BREAK
case 121:
YY_RULE_SETUP
#line 285 "../SqlLexer.lpp"
return TOKEN_WINDOW;
YY_BREAK
case 122:
YY_RULE_SETUP
#line 286 "../SqlLexer.lpp"
return TOKEN_WITH;
YY_BREAK
case 123:
YY_RULE_SETUP
#line 287 "../SqlLexer.lpp"
return TOKEN_YEAR;
YY_BREAK
case 124:
YY_RULE_SETUP
#line 288 "../SqlLexer.lpp"
return TOKEN_YEARMONTH;
YY_BREAK
case 125:
YY_RULE_SETUP
#line 290 "../SqlLexer.lpp"
return TOKEN_EQ;
YY_BREAK
case 126:
YY_RULE_SETUP
#line 291 "../SqlLexer.lpp"
return TOKEN_NEQ;
YY_BREAK
case 127:
YY_RULE_SETUP
#line 292 "../SqlLexer.lpp"
return TOKEN_NEQ;
YY_BREAK
case 128:
YY_RULE_SETUP
#line 293 "../SqlLexer.lpp"
return TOKEN_LT;
YY_BREAK
case 129:
YY_RULE_SETUP
#line 294 "../SqlLexer.lpp"
return TOKEN_GT;
YY_BREAK
case 130:
YY_RULE_SETUP
#line 295 "../SqlLexer.lpp"
return TOKEN_LEQ;
YY_BREAK
case 131:
YY_RULE_SETUP
#line 296 "../SqlLexer.lpp"
return TOKEN_GEQ;
YY_BREAK
case 132:
YY_RULE_SETUP
#line 298 "../SqlLexer.lpp"
return yytext[0];
YY_BREAK
case 133:
YY_RULE_SETUP
#line 299 "../SqlLexer.lpp"
return yytext[0];
YY_BREAK
/**
* Quoted strings. Prefacing a string with an 'e' or 'E' causes escape
* sequences to be processed (as in PostgreSQL).
**/
case 134:
YY_RULE_SETUP
#line 305 "../SqlLexer.lpp"
{
yylval->string_value_ = new quickstep::ParseString(yylloc->first_line, yylloc->first_column);
BEGIN(CONDITION_STRING_SINGLE_QUOTED_ESCAPED);
}
YY_BREAK
case 135:
YY_RULE_SETUP
#line 310 "../SqlLexer.lpp"
{
yylval->string_value_ = new quickstep::ParseString(yylloc->first_line, yylloc->first_column);
BEGIN(CONDITION_STRING_SINGLE_QUOTED);
}
YY_BREAK
case 136:
YY_RULE_SETUP
#line 315 "../SqlLexer.lpp"
{
yylval->string_value_ = new quickstep::ParseString(yylloc->first_line, yylloc->first_column);
BEGIN(CONDITION_STRING_DOUBLE_QUOTED);
}
YY_BREAK
/* CONDITION_SQL */
/* Catch an unterminated string. */
case YY_STATE_EOF(CONDITION_STRING_SINGLE_QUOTED):
case YY_STATE_EOF(CONDITION_STRING_SINGLE_QUOTED_ESCAPED):
case YY_STATE_EOF(CONDITION_STRING_DOUBLE_QUOTED):
#line 324 "../SqlLexer.lpp"
{
delete yylval->string_value_;
BEGIN(INITIAL);
quickstep_yyerror(NULL, yyscanner, NULL, "unterminated string");
return TOKEN_LEX_ERROR;
}
YY_BREAK
/* Process escape sequences. */
case 137:
YY_RULE_SETUP
#line 334 "../SqlLexer.lpp"
{
/* Octal code */
unsigned int code;
std::sscanf(yytext + 1, "%o", &code);
if (code > 0xff) {
delete yylval->string_value_;
BEGIN(INITIAL);
quickstep_yyerror(NULL, yyscanner, NULL, "octal escape sequence out of 1-byte range");
return TOKEN_LEX_ERROR;
}
yylval->string_value_->push_back(code);
}
YY_BREAK
case 138:
YY_RULE_SETUP
#line 346 "../SqlLexer.lpp"
{
/* Hexadecimal code */
unsigned int code;
std::sscanf(yytext + 2, "%x", &code);
yylval->string_value_->push_back(code);
}
YY_BREAK
case 139:
YY_RULE_SETUP
#line 352 "../SqlLexer.lpp"
{
/* A numeric escape sequence that isn't correctly specified. */
delete yylval->string_value_;
BEGIN(INITIAL);
quickstep_yyerror(NULL, yyscanner, NULL, "bad numeric escape sequence (must be octal or hex)");
return TOKEN_LEX_ERROR;
}
YY_BREAK
case 140:
YY_RULE_SETUP
#line 359 "../SqlLexer.lpp"
{
/* Backspace */
yylval->string_value_->push_back('\b');
}
YY_BREAK
case 141:
YY_RULE_SETUP
#line 363 "../SqlLexer.lpp"
{
/* Form-feed */
yylval->string_value_->push_back('\f');
}
YY_BREAK
case 142:
YY_RULE_SETUP
#line 367 "../SqlLexer.lpp"
{
/* Newline */
yylval->string_value_->push_back('\n');
}
YY_BREAK
case 143:
YY_RULE_SETUP
#line 371 "../SqlLexer.lpp"
{
/* Carriage-return */
yylval->string_value_->push_back('\r');
}
YY_BREAK
case 144:
YY_RULE_SETUP
#line 375 "../SqlLexer.lpp"
{
/* Horizontal Tab */
yylval->string_value_->push_back('\t');
}
YY_BREAK
case 145:
/* rule 145 can match eol */
YY_RULE_SETUP
#line 379 "../SqlLexer.lpp"
{
/* Any other character (including actual newline or carriage return) */
yylval->string_value_->push_back(yytext[1]);
}
YY_BREAK
case 146:
YY_RULE_SETUP
#line 383 "../SqlLexer.lpp"
{
/* This should only be encountered right before an EOF. */
delete yylval->string_value_;
BEGIN(INITIAL);
quickstep_yyerror(NULL, yyscanner, NULL, "unfinished escape sequence");
return TOKEN_LEX_ERROR;
}
YY_BREAK
case 147:
YY_RULE_SETUP
#line 393 "../SqlLexer.lpp"
{
/* Two quotes in a row become a single quote (this is specified by the SQL standard). */
yylval->string_value_->push_back('\'');
}
YY_BREAK
case 148:
YY_RULE_SETUP
#line 397 "../SqlLexer.lpp"
{
/* End string */
BEGIN(CONDITION_SQL);
return TOKEN_STRING_SINGLE_QUOTED;
}
YY_BREAK
case 149:
YY_RULE_SETUP
#line 405 "../SqlLexer.lpp"
{
/* Two quotes in a row become a single quote (this is specified by the SQL standard). */
yylval->string_value_->push_back('"');
}
YY_BREAK
case 150:
YY_RULE_SETUP
#line 409 "../SqlLexer.lpp"
{
/* End string */
BEGIN(CONDITION_SQL);
return TOKEN_STRING_DOUBLE_QUOTED;
}
YY_BREAK
case 151:
/* rule 151 can match eol */
YY_RULE_SETUP
#line 416 "../SqlLexer.lpp"
{
/* Scan up to a quote. */
yylval->string_value_->append(yytext, yyleng);
}
YY_BREAK
case 152:
/* rule 152 can match eol */
YY_RULE_SETUP
#line 421 "../SqlLexer.lpp"
{
/* Scan up to a quote or escape sequence. */
yylval->string_value_->append(yytext, yyleng);
}
YY_BREAK
case 153:
/* rule 153 can match eol */
YY_RULE_SETUP
#line 426 "../SqlLexer.lpp"
{
/* Scan up to a quote. */
yylval->string_value_->append(yytext, yyleng);
}
YY_BREAK
case 154:
YY_RULE_SETUP
#line 432 "../SqlLexer.lpp"
{
yylval->string_value_ = new quickstep::ParseString(
yylloc->first_line, yylloc->first_column, std::string(yytext, yyleng));
return TOKEN_NAME;
}
YY_BREAK
case 155:
YY_RULE_SETUP
#line 438 "../SqlLexer.lpp"
{
yylval->numeric_literal_value_ = new quickstep::NumericParseLiteralValue(
yylloc->first_line, yylloc->first_column, yytext);
return TOKEN_UNSIGNED_NUMVAL;
}
YY_BREAK
case 156:
YY_RULE_SETUP
#line 444 "../SqlLexer.lpp"
/* comment */
YY_BREAK
case 157:
/* rule 157 can match eol */
YY_RULE_SETUP
#line 446 "../SqlLexer.lpp"
{ yycolumn = 0; }
YY_BREAK
case 158:
YY_RULE_SETUP
#line 448 "../SqlLexer.lpp"
; /* ignore white space */
YY_BREAK
/* CONDITION_SQL */
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(CONDITION_COMMAND):
case YY_STATE_EOF(CONDITION_SQL):
#line 452 "../SqlLexer.lpp"
{
/* All conditions except for mutli-state string extracting conditions. */
BEGIN(INITIAL);
return TOKEN_EOF;
}
YY_BREAK
case 159:
YY_RULE_SETUP
#line 458 "../SqlLexer.lpp"
{
BEGIN(INITIAL);
quickstep_yyerror(NULL, yyscanner, NULL, "illegal character");
return TOKEN_LEX_ERROR;
}
YY_BREAK
case 160:
YY_RULE_SETUP
#line 464 "../SqlLexer.lpp"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
#line 2399 "SqlLexer_gen.cpp"
case YY_END_OF_BUFFER:
{
/* Amount of text matched not including the EOB char. */
int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = yyg->yy_hold_char;
YY_RESTORE_YY_MORE_OFFSET
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed yyin at a new source and called
* quickstep_yylex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
*/
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
}
/* Note that here we test for yy_c_buf_p "<=" to the position
* of the first EOB in the buffer, since yy_c_buf_p will
* already have been incremented past the NUL character
* (since all states make transitions on EOB to the
* end-of-buffer state). Contrast this with the test
* in input().
*/
if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
{ /* This was really a NUL. */
yy_state_type yy_next_state;
yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state( yyscanner );
/* Okay, we're now positioned to make the NUL
* transition. We couldn't have
* yy_get_previous_state() go ahead and do it
* for us because it doesn't know how to deal
* with the possibility of jamming (and we don't
* want to build jamming into it because then it
* will run more slowly).
*/
yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
if ( yy_next_state )
{
/* Consume the NUL. */
yy_cp = ++yyg->yy_c_buf_p;
yy_current_state = yy_next_state;
goto yy_match;
}
else
{
yy_cp = yyg->yy_last_accepting_cpos;
yy_current_state = yyg->yy_last_accepting_state;
goto yy_find_action;
}
}
else switch ( yy_get_next_buffer( yyscanner ) )
{
case EOB_ACT_END_OF_FILE:
{
yyg->yy_did_buffer_switch_on_eof = 0;
if ( quickstep_yywrap(yyscanner ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
* yytext, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
* YY_NULL, it'll still work - another
* YY_NULL will get returned.
*/
yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
yy_act = YY_STATE_EOF(YY_START);
goto do_action;
}
else
{
if ( ! yyg->yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
}
break;
}
case EOB_ACT_CONTINUE_SCAN:
yyg->yy_c_buf_p =
yyg->yytext_ptr + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state( yyscanner );
yy_cp = yyg->yy_c_buf_p;
yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
goto yy_match;
case EOB_ACT_LAST_MATCH:
yyg->yy_c_buf_p =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
yy_current_state = yy_get_previous_state( yyscanner );
yy_cp = yyg->yy_c_buf_p;
yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
goto yy_find_action;
}
break;
}
default:
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
} /* end of user's declarations */
} /* end of quickstep_yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
* EOB_ACT_LAST_MATCH -
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
static int yy_get_next_buffer (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
register char *source = yyg->yytext_ptr;
register int number_to_move, i;
int ret_val;
if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */
if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
{
/* We matched a single character, the EOB, so
* treat this as a final EOF.
*/
return EOB_ACT_END_OF_FILE;
}
else
{
/* We matched some text prior to the EOB, first
* process it.
*/
return EOB_ACT_LAST_MATCH;
}
}
/* Try to read more data. */
/* First move last chars to start of buffer. */
number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
else
{
yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
int yy_c_buf_p_offset =
(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
yy_size_t new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
else
b->yy_buf_size *= 2;
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
quickstep_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
}
else
/* Can't grow it, we don't own it. */
b->yy_ch_buf = 0;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
number_to_move - 1;
}
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
yyg->yy_n_chars, num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
}
if ( yyg->yy_n_chars == 0 )
{
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
quickstep_yyrestart(yyin ,yyscanner);
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
YY_BUFFER_EOF_PENDING;
}
}
else
ret_val = EOB_ACT_CONTINUE_SCAN;
if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) quickstep_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
}
yyg->yy_n_chars += number_to_move;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
{
register yy_state_type yy_current_state;
register char *yy_cp;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_current_state = yyg->yy_start;
for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
{
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
yyg->yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 588 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
}
return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
{
register int yy_is_jam;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
register char *yy_cp = yyg->yy_c_buf_p;
register YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
yyg->yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 588 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 587);
(void)yyg;
return yy_is_jam ? 0 : yy_current_state;
}
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (yyscan_t yyscanner)
#else
static int input (yyscan_t yyscanner)
#endif
{
int c;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
*yyg->yy_c_buf_p = yyg->yy_hold_char;
if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
/* This was really a NUL. */
*yyg->yy_c_buf_p = '\0';
else
{ /* need more input */
yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
++yyg->yy_c_buf_p;
switch ( yy_get_next_buffer( yyscanner ) )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
* sees that we've accumulated a
* token and flags that we need to
* try matching the token before
* proceeding. But for input(),
* there's no matching to consider.
* So convert the EOB_ACT_LAST_MATCH
* to EOB_ACT_END_OF_FILE.
*/
/* Reset buffer status. */
quickstep_yyrestart(yyin ,yyscanner);
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
if ( quickstep_yywrap(yyscanner ) )
return EOF;
if ( ! yyg->yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
#ifdef __cplusplus
return yyinput(yyscanner);
#else
return input(yyscanner);
#endif
}
case EOB_ACT_CONTINUE_SCAN:
yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
break;
}
}
}
c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
*yyg->yy_c_buf_p = '\0'; /* preserve yytext */
yyg->yy_hold_char = *++yyg->yy_c_buf_p;
if ( c == '\n' )
do{ yylineno++;
yycolumn=0;
}while(0)
;
return c;
}
#endif /* ifndef YY_NO_INPUT */
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
* @param yyscanner The scanner object.
* @note This function does not reset the start condition to @c INITIAL .
*/
void quickstep_yyrestart (FILE * input_file , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! YY_CURRENT_BUFFER ){
quickstep_yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
quickstep_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
}
quickstep_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
quickstep_yy_load_buffer_state(yyscanner );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
* @param yyscanner The scanner object.
*/
void quickstep_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* TODO. We should be able to replace this entire function body
* with
* quickstep_yypop_buffer_state();
* quickstep_yypush_buffer_state(new_buffer);
*/
quickstep_yyensure_buffer_stack (yyscanner);
if ( YY_CURRENT_BUFFER == new_buffer )
return;
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
*yyg->yy_c_buf_p = yyg->yy_hold_char;
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
quickstep_yy_load_buffer_state(yyscanner );
/* We don't actually know whether we did this switch during
* EOF (quickstep_yywrap()) processing, but the only time this flag
* is looked at is after quickstep_yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yyg->yy_did_buffer_switch_on_eof = 1;
}
static void quickstep_yy_load_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
yyg->yy_hold_char = *yyg->yy_c_buf_p;
}
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
* @param yyscanner The scanner object.
* @return the allocated buffer state.
*/
YY_BUFFER_STATE quickstep_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) quickstep_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in quickstep_yy_create_buffer()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
b->yy_ch_buf = (char *) quickstep_yyalloc(b->yy_buf_size + 2 ,yyscanner );
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in quickstep_yy_create_buffer()" );
b->yy_is_our_buffer = 1;
quickstep_yy_init_buffer(b,file ,yyscanner);
return b;
}
/** Destroy the buffer.
* @param b a buffer created with quickstep_yy_create_buffer()
* @param yyscanner The scanner object.
*/
void quickstep_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! b )
return;
if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
quickstep_yyfree((void *) b->yy_ch_buf ,yyscanner );
quickstep_yyfree((void *) b ,yyscanner );
}
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a quickstep_yyrestart() or at EOF.
*/
static void quickstep_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
{
int oerrno = errno;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
quickstep_yy_flush_buffer(b ,yyscanner);
b->yy_input_file = file;
b->yy_fill_buffer = 1;
/* If b is the current buffer, then quickstep_yy_init_buffer was _probably_
* called from quickstep_yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
b->yy_bs_lineno = 1;
b->yy_bs_column = 0;
}
b->yy_is_interactive = 0;
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
* @param yyscanner The scanner object.
*/
void quickstep_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! b )
return;
b->yy_n_chars = 0;
/* We always need two end-of-buffer characters. The first causes
* a transition to the end-of-buffer state. The second causes
* a jam in that state.
*/
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
b->yy_buf_pos = &b->yy_ch_buf[0];
b->yy_at_bol = 1;
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
quickstep_yy_load_buffer_state(yyscanner );
}
/** Pushes the new state onto the stack. The new state becomes
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
* @param yyscanner The scanner object.
*/
void quickstep_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (new_buffer == NULL)
return;
quickstep_yyensure_buffer_stack(yyscanner);
/* This block is copied from quickstep_yy_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
*yyg->yy_c_buf_p = yyg->yy_hold_char;
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
}
/* Only push if top exists. Otherwise, replace top. */
if (YY_CURRENT_BUFFER)
yyg->yy_buffer_stack_top++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
/* copied from quickstep_yy_switch_to_buffer. */
quickstep_yy_load_buffer_state(yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
* @param yyscanner The scanner object.
*/
void quickstep_yypop_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!YY_CURRENT_BUFFER)
return;
quickstep_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
YY_CURRENT_BUFFER_LVALUE = NULL;
if (yyg->yy_buffer_stack_top > 0)
--yyg->yy_buffer_stack_top;
if (YY_CURRENT_BUFFER) {
quickstep_yy_load_buffer_state(yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
}
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
static void quickstep_yyensure_buffer_stack (yyscan_t yyscanner)
{
yy_size_t num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!yyg->yy_buffer_stack) {
/* First allocation is just for 2 elements, since we don't know if this
* scanner will even need a stack. We use 2 instead of 1 to avoid an
* immediate realloc on the next call.
*/
num_to_alloc = 1;
yyg->yy_buffer_stack = (struct yy_buffer_state**)quickstep_yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
YY_FATAL_ERROR( "out of dynamic memory in quickstep_yyensure_buffer_stack()" );
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
yyg->yy_buffer_stack_max = num_to_alloc;
yyg->yy_buffer_stack_top = 0;
return;
}
if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
/* Increase the buffer to prepare for a possible push. */
int grow_size = 8 /* arbitrary grow size */;
num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
yyg->yy_buffer_stack = (struct yy_buffer_state**)quickstep_yyrealloc
(yyg->yy_buffer_stack,
num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
YY_FATAL_ERROR( "out of dynamic memory in quickstep_yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
yyg->yy_buffer_stack_max = num_to_alloc;
}
}
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE quickstep_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
return 0;
b = (YY_BUFFER_STATE) quickstep_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in quickstep_yy_scan_buffer()" );
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = 0;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
quickstep_yy_switch_to_buffer(b ,yyscanner );
return b;
}
/** Setup the input buffer state to scan a string. The next call to quickstep_yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* quickstep_yy_scan_bytes() instead.
*/
YY_BUFFER_STATE quickstep_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
{
return quickstep_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
}
/** Setup the input buffer state to scan the given bytes. The next call to quickstep_yylex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE quickstep_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
yy_size_t i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) quickstep_yyalloc(n ,yyscanner );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in quickstep_yy_scan_bytes()" );
for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
b = quickstep_yy_scan_buffer(buf,n ,yyscanner);
if ( ! b )
YY_FATAL_ERROR( "bad buffer in quickstep_yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
*/
b->yy_is_our_buffer = 1;
return b;
}
#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif
static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
yytext[yyleng] = yyg->yy_hold_char; \
yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
yyg->yy_hold_char = *yyg->yy_c_buf_p; \
*yyg->yy_c_buf_p = '\0'; \
yyleng = yyless_macro_arg; \
} \
while ( 0 )
/* Accessor methods (get/set functions) to struct members. */
/** Get the user-defined data for this scanner.
* @param yyscanner The scanner object.
*/
YY_EXTRA_TYPE quickstep_yyget_extra (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyextra;
}
/** Get the current line number.
* @param yyscanner The scanner object.
*/
int quickstep_yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (! YY_CURRENT_BUFFER)
return 0;
return yylineno;
}
/** Get the current column number.
* @param yyscanner The scanner object.
*/
int quickstep_yyget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (! YY_CURRENT_BUFFER)
return 0;
return yycolumn;
}
/** Get the input stream.
* @param yyscanner The scanner object.
*/
FILE *quickstep_yyget_in (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyin;
}
/** Get the output stream.
* @param yyscanner The scanner object.
*/
FILE *quickstep_yyget_out (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyout;
}
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
yy_size_t quickstep_yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
}
/** Get the current token.
* @param yyscanner The scanner object.
*/
char *quickstep_yyget_text (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yytext;
}
/** Set the user-defined data. This data is never touched by the scanner.
* @param user_defined The data to be associated with this scanner.
* @param yyscanner The scanner object.
*/
void quickstep_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyextra = user_defined ;
}
/** Set the current line number.
* @param line_number
* @param yyscanner The scanner object.
*/
void quickstep_yyset_lineno (int line_number , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
YY_FATAL_ERROR( "quickstep_yyset_lineno called with no buffer" );
yylineno = line_number;
}
/** Set the current column.
* @param line_number
* @param yyscanner The scanner object.
*/
void quickstep_yyset_column (int column_no , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
YY_FATAL_ERROR( "quickstep_yyset_column called with no buffer" );
yycolumn = column_no;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param in_str A readable stream.
* @param yyscanner The scanner object.
* @see quickstep_yy_switch_to_buffer
*/
void quickstep_yyset_in (FILE * in_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyin = in_str ;
}
void quickstep_yyset_out (FILE * out_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyout = out_str ;
}
int quickstep_yyget_debug (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yy_flex_debug;
}
void quickstep_yyset_debug (int bdebug , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_flex_debug = bdebug ;
}
/* Accessor methods for yylval and yylloc */
YYSTYPE * quickstep_yyget_lval (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yylval;
}
void quickstep_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yylval = yylval_param;
}
YYLTYPE *quickstep_yyget_lloc (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yylloc;
}
void quickstep_yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yylloc = yylloc_param;
}
/* User-visible API */
/* quickstep_yylex_init is special because it creates the scanner itself, so it is
* the ONLY reentrant function that doesn't take the scanner as the last argument.
* That's why we explicitly handle the declaration, instead of using our macros.
*/
int quickstep_yylex_init(yyscan_t* ptr_yy_globals)
{
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
*ptr_yy_globals = (yyscan_t) quickstep_yyalloc ( sizeof( struct yyguts_t ), NULL );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
return 1;
}
/* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
return yy_init_globals ( *ptr_yy_globals );
}
/* quickstep_yylex_init_extra has the same functionality as quickstep_yylex_init, but follows the
* convention of taking the scanner as the last argument. Note however, that
* this is a *pointer* to a scanner, as it will be allocated by this call (and
* is the reason, too, why this function also must handle its own declaration).
* The user defined value in the first argument will be available to quickstep_yyalloc in
* the yyextra field.
*/
int quickstep_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
{
struct yyguts_t dummy_yyguts;
quickstep_yyset_extra (yy_user_defined, &dummy_yyguts);
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
*ptr_yy_globals = (yyscan_t) quickstep_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
return 1;
}
/* By setting to 0xAA, we expose bugs in
yy_init_globals. Leave at 0x00 for releases. */
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
quickstep_yyset_extra (yy_user_defined, *ptr_yy_globals);
return yy_init_globals ( *ptr_yy_globals );
}
static int yy_init_globals (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Initialization is the same as for the non-reentrant scanner.
* This function is called from quickstep_yylex_destroy(), so don't allocate here.
*/
yyg->yy_buffer_stack = 0;
yyg->yy_buffer_stack_top = 0;
yyg->yy_buffer_stack_max = 0;
yyg->yy_c_buf_p = (char *) 0;
yyg->yy_init = 0;
yyg->yy_start = 0;
yyg->yy_start_stack_ptr = 0;
yyg->yy_start_stack_depth = 0;
yyg->yy_start_stack = NULL;
/* Defined in main.c */
#ifdef YY_STDINIT
yyin = stdin;
yyout = stdout;
#else
yyin = (FILE *) 0;
yyout = (FILE *) 0;
#endif
/* For future reference: Set errno on error, since we are called by
* quickstep_yylex_init()
*/
return 0;
}
/* quickstep_yylex_destroy is for both reentrant and non-reentrant scanners. */
int quickstep_yylex_destroy (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
quickstep_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
YY_CURRENT_BUFFER_LVALUE = NULL;
quickstep_yypop_buffer_state(yyscanner);
}
/* Destroy the stack itself. */
quickstep_yyfree(yyg->yy_buffer_stack ,yyscanner);
yyg->yy_buffer_stack = NULL;
/* Destroy the start condition stack. */
quickstep_yyfree(yyg->yy_start_stack ,yyscanner );
yyg->yy_start_stack = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
* quickstep_yylex() is called, initialization will occur. */
yy_init_globals( yyscanner);
/* Destroy the main struct (reentrant only). */
quickstep_yyfree ( yyscanner , yyscanner );
yyscanner = NULL;
return 0;
}
/*
* Internal utility routines.
*/
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
{
register int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
{
register int n;
for ( n = 0; s[n]; ++n )
;
return n;
}
#endif
void *quickstep_yyalloc (yy_size_t size , yyscan_t yyscanner)
{
return (void *) malloc( size );
}
void *quickstep_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
* because both ANSI C and C++ allow castless assignment from
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
return (void *) realloc( (char *) ptr, size );
}
void quickstep_yyfree (void * ptr , yyscan_t yyscanner)
{
free( (char *) ptr ); /* see quickstep_yyrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
#line 463 "../SqlLexer.lpp"
| 30.121229 | 136 | 0.620077 | [
"object",
"vector"
] |
d02eecfaae2fa8a44d51224598068271360e3105 | 1,292 | cpp | C++ | day2_for_each.cpp | KuKuXia/30-Days-Plan-for-Practicing-C-Plus-Plus-11-STL | dddb1f3f6b43b628b87dcb26b72495e5c7d19e55 | [
"MIT"
] | null | null | null | day2_for_each.cpp | KuKuXia/30-Days-Plan-for-Practicing-C-Plus-Plus-11-STL | dddb1f3f6b43b628b87dcb26b72495e5c7d19e55 | [
"MIT"
] | null | null | null | day2_for_each.cpp | KuKuXia/30-Days-Plan-for-Practicing-C-Plus-Plus-11-STL | dddb1f3f6b43b628b87dcb26b72495e5c7d19e55 | [
"MIT"
] | null | null | null | //
// Created by LongXiaJun on 2018/12/8 0008.
//
#include <vector>
#include <algorithm>
#include <iostream>
#include "day2_for_each.h"
namespace demo_for_each {
namespace definition_for_each {
// Possible Definition
template<typename InputIt, typename UnaryFunction>
UnaryFunction for_each(InputIt first, InputIt last, UnaryFunction f) {
for (; first != last; ++first) {
f(*first);
}
return f;
}
}
struct Sum {
Sum() : sum{0} {}
void operator()(int n) { sum += n; }
int sum;
};
std::vector<int> nums{3, 4, 4, 5, 5, 6, 6, 7, 2};
auto print = [](const int &n) { std::cout << " " << n; };
void stl_for_each() {
std::cout << "STL for_each usage demo: " << std::endl;
std::cout << "Before: ";
std::for_each(nums.begin(), nums.end(), print);
std::cout << "\n";
std::for_each(nums.begin(), nums.end(), [](int &n) { n++; });
Sum s = std::for_each(nums.begin(), nums.end(), Sum());
std::cout << "After add one to each object: ";
definition_for_each::for_each(nums.begin(), nums.end(), print);
std::cout << "\n";
std::cout << "Total Sum: " << s.sum << std::endl;
}
} | 24.377358 | 78 | 0.51935 | [
"object",
"vector"
] |
d02f415cf74fb92d8a3d661a34fff4dfd2bf2d15 | 160,956 | hpp | C++ | extras/lzma_c.hpp | SSBMTonberry/pocketlzma | 46c5ca4071dee47025acd95d01c71032e53bef74 | [
"BSD-2-Clause"
] | 5 | 2021-02-19T19:10:33.000Z | 2022-01-22T07:46:14.000Z | extras/lzma_c.hpp | SSBMTonberry/pocketlzma | 46c5ca4071dee47025acd95d01c71032e53bef74 | [
"BSD-2-Clause"
] | null | null | null | extras/lzma_c.hpp | SSBMTonberry/pocketlzma | 46c5ca4071dee47025acd95d01c71032e53bef74 | [
"BSD-2-Clause"
] | null | null | null | /*!
* Public Domain
*
* This is a slightly modified cross-platform single-header version of Igor Pavlov's C-implementation of LZMA.
* This is released under Public Domain to honor Igor Pavlov's hard work, which he himself put under Public Domain
* for all of us to use as we please. So all credit for the LZMA logic here goes to Igor Pavlov himself.
*
* Amalgamation (single-header) and cross-platform modifications done by Robin Berg Pettersen.
* NOTE: In order to make this cross-platform, all multithreading logic had to be removed.
*
* Use at own risk. There is absolutely NO SUPPORT for using this file.
*
* To be able to use this, you must define "LZMA_C_DEFINE" ONCE before including "lzma_c.hpp", like this:
*
* #define LZMA_C_DEFINE
* #include "lzma_c.hpp"
*
*/
#ifdef _WIN32
#include <windows.h>
#endif
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
/*** Start of inlined file: 7zTypes.h ***/
#ifndef __7Z_TYPES_H
#define __7Z_TYPES_H
//#ifdef _WIN32
///* #include <windows.h> */
//#endif
//#include <stddef.h>
#ifndef EXTERN_C_BEGIN
#ifdef __cplusplus
#define EXTERN_C_BEGIN extern "C" {
#define EXTERN_C_END }
#else
#define EXTERN_C_BEGIN
#define EXTERN_C_END
#endif
#endif
EXTERN_C_BEGIN
#define SZ_OK 0
#define SZ_ERROR_DATA 1
#define SZ_ERROR_MEM 2
#define SZ_ERROR_CRC 3
#define SZ_ERROR_UNSUPPORTED 4
#define SZ_ERROR_PARAM 5
#define SZ_ERROR_INPUT_EOF 6
#define SZ_ERROR_OUTPUT_EOF 7
#define SZ_ERROR_READ 8
#define SZ_ERROR_WRITE 9
#define SZ_ERROR_PROGRESS 10
#define SZ_ERROR_FAIL 11
#define SZ_ERROR_THREAD 12
#define SZ_ERROR_ARCHIVE 16
#define SZ_ERROR_NO_ARCHIVE 17
typedef int SRes;
#ifdef _WIN32
/* typedef DWORD WRes; */
typedef unsigned WRes;
#define MY_SRes_HRESULT_FROM_WRes(x) HRESULT_FROM_WIN32(x)
#else
typedef int WRes;
#define MY__FACILITY_WIN32 7
#define MY__FACILITY__WRes MY__FACILITY_WIN32
#define MY_SRes_HRESULT_FROM_WRes(x) ((HRESULT)(x) <= 0 ? ((HRESULT)(x)) : ((HRESULT) (((x) & 0x0000FFFF) | (MY__FACILITY__WRes << 16) | 0x80000000)))
#endif
#ifndef RINOK
#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
#endif
typedef unsigned char Byte;
typedef short Int16;
typedef unsigned short UInt16;
#ifdef _LZMA_UINT32_IS_ULONG
typedef long Int32;
typedef unsigned long UInt32;
#else
typedef int Int32;
typedef unsigned int UInt32;
#endif
#ifdef _SZ_NO_INT_64
/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers.
NOTES: Some code will work incorrectly in that case! */
typedef long Int64;
typedef unsigned long UInt64;
#else
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 Int64;
typedef unsigned __int64 UInt64;
#define UINT64_CONST(n) n
#else
typedef long long int Int64;
typedef unsigned long long int UInt64;
#define UINT64_CONST(n) n ## ULL
#endif
#endif
#ifdef _LZMA_NO_SYSTEM_SIZE_T
typedef UInt32 SizeT;
#else
typedef size_t SizeT;
#endif
typedef int BoolInt;
/* typedef BoolInt Bool; */
#define True 1
#define False 0
#ifdef _WIN32
#define MY_STD_CALL __stdcall
#else
#define MY_STD_CALL
#endif
#ifdef _MSC_VER
#if _MSC_VER >= 1300
#define MY_NO_INLINE __declspec(noinline)
#else
#define MY_NO_INLINE
#endif
#define MY_FORCE_INLINE __forceinline
#define MY_CDECL __cdecl
#define MY_FAST_CALL __fastcall
#else
#define MY_NO_INLINE
#define MY_FORCE_INLINE
#define MY_CDECL
#define MY_FAST_CALL
/* inline keyword : for C++ / C99 */
/* GCC, clang: */
/*
#if defined (__GNUC__) && (__GNUC__ >= 4)
#define MY_FORCE_INLINE __attribute__((always_inline))
#define MY_NO_INLINE __attribute__((noinline))
#endif
*/
#endif
/* The following interfaces use first parameter as pointer to structure */
typedef struct IByteIn IByteIn;
struct IByteIn
{
Byte (*Read)(const IByteIn *p); /* reads one byte, returns 0 in case of EOF or error */
};
#define IByteIn_Read(p) (p)->Read(p)
typedef struct IByteOut IByteOut;
struct IByteOut
{
void (*Write)(const IByteOut *p, Byte b);
};
#define IByteOut_Write(p, b) (p)->Write(p, b)
typedef struct ISeqInStream ISeqInStream;
struct ISeqInStream
{
SRes (*Read)(const ISeqInStream *p, void *buf, size_t *size);
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
(output(*size) < input(*size)) is allowed */
};
#define ISeqInStream_Read(p, buf, size) (p)->Read(p, buf, size)
/* it can return SZ_ERROR_INPUT_EOF */
SRes SeqInStream_Read(const ISeqInStream *stream, void *buf, size_t size);
SRes SeqInStream_Read2(const ISeqInStream *stream, void *buf, size_t size, SRes errorType);
SRes SeqInStream_ReadByte(const ISeqInStream *stream, Byte *buf);
typedef struct ISeqOutStream ISeqOutStream;
struct ISeqOutStream
{
size_t (*Write)(const ISeqOutStream *p, const void *buf, size_t size);
/* Returns: result - the number of actually written bytes.
(result < size) means error */
};
#define ISeqOutStream_Write(p, buf, size) (p)->Write(p, buf, size)
typedef enum
{
SZ_SEEK_SET = 0,
SZ_SEEK_CUR = 1,
SZ_SEEK_END = 2
} ESzSeek;
typedef struct ISeekInStream ISeekInStream;
struct ISeekInStream
{
SRes (*Read)(const ISeekInStream *p, void *buf, size_t *size); /* same as ISeqInStream::Read */
SRes (*Seek)(const ISeekInStream *p, Int64 *pos, ESzSeek origin);
};
#define ISeekInStream_Read(p, buf, size) (p)->Read(p, buf, size)
#define ISeekInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin)
typedef struct ILookInStream ILookInStream;
struct ILookInStream
{
SRes (*Look)(const ILookInStream *p, const void **buf, size_t *size);
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
(output(*size) > input(*size)) is not allowed
(output(*size) < input(*size)) is allowed */
SRes (*Skip)(const ILookInStream *p, size_t offset);
/* offset must be <= output(*size) of Look */
SRes (*Read)(const ILookInStream *p, void *buf, size_t *size);
/* reads directly (without buffer). It's same as ISeqInStream::Read */
SRes (*Seek)(const ILookInStream *p, Int64 *pos, ESzSeek origin);
};
#define ILookInStream_Look(p, buf, size) (p)->Look(p, buf, size)
#define ILookInStream_Skip(p, offset) (p)->Skip(p, offset)
#define ILookInStream_Read(p, buf, size) (p)->Read(p, buf, size)
#define ILookInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin)
SRes LookInStream_LookRead(const ILookInStream *stream, void *buf, size_t *size);
SRes LookInStream_SeekTo(const ILookInStream *stream, UInt64 offset);
/* reads via ILookInStream::Read */
SRes LookInStream_Read2(const ILookInStream *stream, void *buf, size_t size, SRes errorType);
SRes LookInStream_Read(const ILookInStream *stream, void *buf, size_t size);
typedef struct
{
ILookInStream vt;
const ISeekInStream *realStream;
size_t pos;
size_t size; /* it's data size */
/* the following variables must be set outside */
Byte *buf;
size_t bufSize;
} CLookToRead2;
void LookToRead2_CreateVTable(CLookToRead2 *p, int lookahead);
#define LookToRead2_Init(p) { (p)->pos = (p)->size = 0; }
typedef struct
{
ISeqInStream vt;
const ILookInStream *realStream;
} CSecToLook;
void SecToLook_CreateVTable(CSecToLook *p);
typedef struct
{
ISeqInStream vt;
const ILookInStream *realStream;
} CSecToRead;
void SecToRead_CreateVTable(CSecToRead *p);
typedef struct ICompressProgress ICompressProgress;
struct ICompressProgress
{
SRes (*Progress)(const ICompressProgress *p, UInt64 inSize, UInt64 outSize);
/* Returns: result. (result != SZ_OK) means break.
Value (UInt64)(Int64)-1 for size means unknown value. */
};
#define ICompressProgress_Progress(p, inSize, outSize) (p)->Progress(p, inSize, outSize)
typedef struct ISzAlloc ISzAlloc;
typedef const ISzAlloc * ISzAllocPtr;
struct ISzAlloc
{
void *(*Alloc)(ISzAllocPtr p, size_t size);
void (*Free)(ISzAllocPtr p, void *address); /* address can be 0 */
};
#define ISzAlloc_Alloc(p, size) (p)->Alloc(p, size)
#define ISzAlloc_Free(p, a) (p)->Free(p, a)
/* deprecated */
#define IAlloc_Alloc(p, size) ISzAlloc_Alloc(p, size)
#define IAlloc_Free(p, a) ISzAlloc_Free(p, a)
#ifndef MY_offsetof
#ifdef offsetof
#define MY_offsetof(type, m) offsetof(type, m)
/*
#define MY_offsetof(type, m) FIELD_OFFSET(type, m)
*/
#else
#define MY_offsetof(type, m) ((size_t)&(((type *)0)->m))
#endif
#endif
#ifndef MY_container_of
/*
#define MY_container_of(ptr, type, m) container_of(ptr, type, m)
#define MY_container_of(ptr, type, m) CONTAINING_RECORD(ptr, type, m)
#define MY_container_of(ptr, type, m) ((type *)((char *)(ptr) - offsetof(type, m)))
#define MY_container_of(ptr, type, m) (&((type *)0)->m == (ptr), ((type *)(((char *)(ptr)) - MY_offsetof(type, m))))
*/
/*
GCC shows warning: "perhaps the 'offsetof' macro was used incorrectly"
GCC 3.4.4 : classes with constructor
GCC 4.8.1 : classes with non-public variable members"
*/
#define MY_container_of(ptr, type, m) ((type *)((char *)(1 ? (ptr) : &((type *)0)->m) - MY_offsetof(type, m)))
#endif
#define CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m) ((type *)(ptr))
/*
#define CONTAINER_FROM_VTBL(ptr, type, m) CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m)
*/
#define CONTAINER_FROM_VTBL(ptr, type, m) MY_container_of(ptr, type, m)
#define CONTAINER_FROM_VTBL_CLS(ptr, type, m) CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m)
/*
#define CONTAINER_FROM_VTBL_CLS(ptr, type, m) CONTAINER_FROM_VTBL(ptr, type, m)
*/
#ifdef _WIN32
#define CHAR_PATH_SEPARATOR '\\'
#define WCHAR_PATH_SEPARATOR L'\\'
#define STRING_PATH_SEPARATOR "\\"
#define WSTRING_PATH_SEPARATOR L"\\"
#else
#define CHAR_PATH_SEPARATOR '/'
#define WCHAR_PATH_SEPARATOR L'/'
#define STRING_PATH_SEPARATOR "/"
#define WSTRING_PATH_SEPARATOR L"/"
#endif
EXTERN_C_END
#endif
/*** End of inlined file: 7zTypes.h ***/
/*** Start of inlined file: Precomp.h ***/
#ifndef __7Z_PRECOMP_H
#define __7Z_PRECOMP_H
/*** Start of inlined file: Compiler.h ***/
#ifndef __7Z_COMPILER_H
#define __7Z_COMPILER_H
#ifdef _MSC_VER
#ifdef UNDER_CE
#define RPC_NO_WINDOWS_H
/* #pragma warning(disable : 4115) // '_RPC_ASYNC_STATE' : named type definition in parentheses */
#pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
#pragma warning(disable : 4214) // nonstandard extension used : bit field types other than int
#endif
#if _MSC_VER >= 1300
#pragma warning(disable : 4996) // This function or variable may be unsafe
#else
#pragma warning(disable : 4511) // copy constructor could not be generated
#pragma warning(disable : 4512) // assignment operator could not be generated
#pragma warning(disable : 4514) // unreferenced inline function has been removed
#pragma warning(disable : 4702) // unreachable code
#pragma warning(disable : 4710) // not inlined
#pragma warning(disable : 4714) // function marked as __forceinline not inlined
#pragma warning(disable : 4786) // identifier was truncated to '255' characters in the debug information
#endif
#endif
#define UNUSED_VAR(x) (void)x;
/* #define UNUSED_VAR(x) x=x; */
#endif
/*** End of inlined file: Compiler.h ***/
/* #include "7zTypes.h" */
#endif
/*** End of inlined file: Precomp.h ***/
/*** Start of inlined file: Alloc.h ***/
#ifndef __COMMON_ALLOC_H
#define __COMMON_ALLOC_H
EXTERN_C_BEGIN
void *MyAlloc(size_t size);
void MyFree(void *address);
#ifdef _WIN32
void SetLargePageSize();
void *MidAlloc(size_t size);
void MidFree(void *address);
void *BigAlloc(size_t size);
void BigFree(void *address);
#else
#define MidAlloc(size) MyAlloc(size)
#define MidFree(address) MyFree(address)
#define BigAlloc(size) MyAlloc(size)
#define BigFree(address) MyFree(address)
#endif
extern const ISzAlloc g_Alloc;
extern const ISzAlloc g_BigAlloc;
extern const ISzAlloc g_MidAlloc;
extern const ISzAlloc g_AlignedAlloc;
typedef struct
{
ISzAlloc vt;
ISzAllocPtr baseAlloc;
unsigned numAlignBits; /* ((1 << numAlignBits) >= sizeof(void *)) */
size_t offset; /* (offset == (k * sizeof(void *)) && offset < (1 << numAlignBits) */
} CAlignOffsetAlloc;
void AlignOffsetAlloc_CreateVTable(CAlignOffsetAlloc *p);
EXTERN_C_END
#endif
/*** End of inlined file: Alloc.h ***/
/*** Start of inlined file: LzmaDec.h ***/
#ifndef __LZMA_DEC_H
#define __LZMA_DEC_H
EXTERN_C_BEGIN
/* #define _LZMA_PROB32 */
/* _LZMA_PROB32 can increase the speed on some CPUs,
but memory usage for CLzmaDec::probs will be doubled in that case */
typedef
#ifdef _LZMA_PROB32
UInt32
#else
UInt16
#endif
CLzmaProb;
/* ---------- LZMA Properties ---------- */
#define LZMA_PROPS_SIZE 5
typedef struct _CLzmaProps
{
Byte lc;
Byte lp;
Byte pb;
Byte _pad_;
UInt32 dicSize;
} CLzmaProps;
/* LzmaProps_Decode - decodes properties
Returns:
SZ_OK
SZ_ERROR_UNSUPPORTED - Unsupported properties
*/
SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
/* ---------- LZMA Decoder state ---------- */
/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.
Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */
#define LZMA_REQUIRED_INPUT_MAX 20
typedef struct
{
/* Don't change this structure. ASM code can use it. */
CLzmaProps prop;
CLzmaProb *probs;
CLzmaProb *probs_1664;
Byte *dic;
SizeT dicBufSize;
SizeT dicPos;
const Byte *buf;
UInt32 range;
UInt32 code;
UInt32 processedPos;
UInt32 checkDicSize;
UInt32 reps[4];
UInt32 state;
UInt32 remainLen;
UInt32 numProbs;
unsigned tempBufSize;
Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
} CLzmaDec;
#define LzmaDec_Construct(p) { (p)->dic = NULL; (p)->probs = NULL; }
void LzmaDec_Init(CLzmaDec *p);
/* There are two types of LZMA streams:
- Stream with end mark. That end mark adds about 6 bytes to compressed size.
- Stream without end mark. You must know exact uncompressed size to decompress such stream. */
typedef enum
{
LZMA_FINISH_ANY, /* finish at any point */
LZMA_FINISH_END /* block must be finished at the end */
} ELzmaFinishMode;
/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!
You must use LZMA_FINISH_END, when you know that current output buffer
covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.
If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,
and output value of destLen will be less than output buffer size limit.
You can check status result also.
You can use multiple checks to test data integrity after full decompression:
1) Check Result and "status" variable.
2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
You must use correct finish mode in that case. */
typedef enum
{
LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */
LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */
LZMA_STATUS_NOT_FINISHED, /* stream was not finished */
LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */
} ELzmaStatus;
/* ELzmaStatus is used only as output value for function call */
/* ---------- Interfaces ---------- */
/* There are 3 levels of interfaces:
1) Dictionary Interface
2) Buffer Interface
3) One Call Interface
You can select any of these interfaces, but don't mix functions from different
groups for same object. */
/* There are two variants to allocate state for Dictionary Interface:
1) LzmaDec_Allocate / LzmaDec_Free
2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs
You can use variant 2, if you set dictionary buffer manually.
For Buffer Interface you must always use variant 1.
LzmaDec_Allocate* can return:
SZ_OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_UNSUPPORTED - Unsupported properties
*/
SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc);
void LzmaDec_FreeProbs(CLzmaDec *p, ISzAllocPtr alloc);
SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc);
void LzmaDec_Free(CLzmaDec *p, ISzAllocPtr alloc);
/* ---------- Dictionary Interface ---------- */
/* You can use it, if you want to eliminate the overhead for data copying from
dictionary to some other external buffer.
You must work with CLzmaDec variables directly in this interface.
STEPS:
LzmaDec_Construct()
LzmaDec_Allocate()
for (each new stream)
{
LzmaDec_Init()
while (it needs more decompression)
{
LzmaDec_DecodeToDic()
use data from CLzmaDec::dic and update CLzmaDec::dicPos
}
}
LzmaDec_Free()
*/
/* LzmaDec_DecodeToDic
The decoding to internal dictionary buffer (CLzmaDec::dic).
You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!
finishMode:
It has meaning only if the decoding reaches output limit (dicLimit).
LZMA_FINISH_ANY - Decode just dicLimit bytes.
LZMA_FINISH_END - Stream must be finished after dicLimit.
Returns:
SZ_OK
status:
LZMA_STATUS_FINISHED_WITH_MARK
LZMA_STATUS_NOT_FINISHED
LZMA_STATUS_NEEDS_MORE_INPUT
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
SZ_ERROR_DATA - Data error
*/
SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
/* ---------- Buffer Interface ---------- */
/* It's zlib-like interface.
See LzmaDec_DecodeToDic description for information about STEPS and return results,
but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need
to work with CLzmaDec variables manually.
finishMode:
It has meaning only if the decoding reaches output limit (*destLen).
LZMA_FINISH_ANY - Decode just destLen bytes.
LZMA_FINISH_END - Stream must be finished after (*destLen).
*/
SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
/* ---------- One Call Interface ---------- */
/* LzmaDecode
finishMode:
It has meaning only if the decoding reaches output limit (*destLen).
LZMA_FINISH_ANY - Decode just destLen bytes.
LZMA_FINISH_END - Stream must be finished after (*destLen).
Returns:
SZ_OK
status:
LZMA_STATUS_FINISHED_WITH_MARK
LZMA_STATUS_NOT_FINISHED
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
SZ_ERROR_DATA - Data error
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_UNSUPPORTED - Unsupported properties
SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
*/
SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
ELzmaStatus *status, ISzAllocPtr alloc);
EXTERN_C_END
#endif
/*** End of inlined file: LzmaDec.h ***/
/*** Start of inlined file: LzmaEnc.h ***/
#ifndef __LZMA_ENC_H
#define __LZMA_ENC_H
EXTERN_C_BEGIN
#define LZMA_PROPS_SIZE 5
typedef struct _CLzmaEncProps
{
int level; /* 0 <= level <= 9 */
UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
(1 << 12) <= dictSize <= (3 << 29) for 64-bit version
default = (1 << 24) */
int lc; /* 0 <= lc <= 8, default = 3 */
int lp; /* 0 <= lp <= 4, default = 0 */
int pb; /* 0 <= pb <= 4, default = 2 */
int algo; /* 0 - fast, 1 - normal, default = 1 */
int fb; /* 5 <= fb <= 273, default = 32 */
int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
int numHashBytes; /* 2, 3 or 4, default = 4 */
UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */
unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
int numThreads; /* 1 or 2, default = 2 */
UInt64 reduceSize; /* estimated size of data that will be compressed. default = (UInt64)(Int64)-1.
Encoder uses this value to reduce dictionary size */
} CLzmaEncProps;
void LzmaEncProps_Init(CLzmaEncProps *p);
void LzmaEncProps_Normalize(CLzmaEncProps *p);
UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
/* ---------- CLzmaEncHandle Interface ---------- */
/* LzmaEnc* functions can return the following exit codes:
SRes:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater in props
SZ_ERROR_WRITE - ISeqOutStream write callback error
SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output
SZ_ERROR_PROGRESS - some break from progress callback
SZ_ERROR_THREAD - error in multithreading functions (only for Mt version)
*/
typedef void * CLzmaEncHandle;
CLzmaEncHandle LzmaEnc_Create(ISzAllocPtr alloc);
void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAllocPtr alloc, ISzAllocPtr allocBig);
SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
void LzmaEnc_SetDataSize(CLzmaEncHandle p, UInt64 expectedDataSiize);
SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
unsigned LzmaEnc_IsWriteEndMark(CLzmaEncHandle p);
SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,
ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);
SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
int writeEndMark, ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);
/* ---------- One Call Interface ---------- */
SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);
EXTERN_C_END
#endif
/*** End of inlined file: LzmaEnc.h ***/
/*** Start of inlined file: LzmaLib.h ***/
#ifndef __LZMA_LIB_H
#define __LZMA_LIB_H
EXTERN_C_BEGIN
#define MY_STDAPI int MY_STD_CALL
#define LZMA_PROPS_SIZE 5
/*
RAM requirements for LZMA:
for compression: (dictSize * 11.5 + 6 MB) + state_size
for decompression: dictSize + state_size
state_size = (4 + (1.5 << (lc + lp))) KB
by default (lc=3, lp=0), state_size = 16 KB.
LZMA properties (5 bytes) format
Offset Size Description
0 1 lc, lp and pb in encoded form.
1 4 dictSize (little endian).
*/
/*
LzmaCompress
------------
outPropsSize -
In: the pointer to the size of outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
Out: the pointer to the size of written properties in outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
LZMA Encoder will use defult values for any parameter, if it is
-1 for any from: level, loc, lp, pb, fb, numThreads
0 for dictSize
level - compression level: 0 <= level <= 9;
level dictSize algo fb
0: 16 KB 0 32
1: 64 KB 0 32
2: 256 KB 0 32
3: 1 MB 0 32
4: 4 MB 0 32
5: 16 MB 1 32
6: 32 MB 1 32
7+: 64 MB 1 64
The default value for "level" is 5.
algo = 0 means fast method
algo = 1 means normal method
dictSize - The dictionary size in bytes. The maximum value is
128 MB = (1 << 27) bytes for 32-bit version
1 GB = (1 << 30) bytes for 64-bit version
The default value is 16 MB = (1 << 24) bytes.
It's recommended to use the dictionary that is larger than 4 KB and
that can be calculated as (1 << N) or (3 << N) sizes.
lc - The number of literal context bits (high bits of previous literal).
It can be in the range from 0 to 8. The default value is 3.
Sometimes lc=4 gives the gain for big files.
lp - The number of literal pos bits (low bits of current position for literals).
It can be in the range from 0 to 4. The default value is 0.
The lp switch is intended for periodical data when the period is equal to 2^lp.
For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's
better to set lc=0, if you change lp switch.
pb - The number of pos bits (low bits of current position).
It can be in the range from 0 to 4. The default value is 2.
The pb switch is intended for periodical data when the period is equal 2^pb.
fb - Word size (the number of fast bytes).
It can be in the range from 5 to 273. The default value is 32.
Usually, a big number gives a little bit better compression ratio and
slower compression process.
numThreads - The number of thereads. 1 or 2. The default value is 2.
Fast mode (algo = 0) can use only 1 thread.
Out:
destLen - processed output size
Returns:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater
SZ_ERROR_OUTPUT_EOF - output buffer overflow
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
*/
MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
unsigned char *outProps, size_t *outPropsSize, /* *outPropsSize must be = 5 */
int level, /* 0 <= level <= 9, default = 5 */
unsigned dictSize, /* default = (1 << 24) */
int lc, /* 0 <= lc <= 8, default = 3 */
int lp, /* 0 <= lp <= 4, default = 0 */
int pb, /* 0 <= pb <= 4, default = 2 */
int fb, /* 5 <= fb <= 273, default = 32 */
int numThreads /* 1 or 2, default = 2 */
);
/*
LzmaUncompress
--------------
In:
dest - output data
destLen - output data size
src - input data
srcLen - input data size
Out:
destLen - processed output size
srcLen - processed input size
Returns:
SZ_OK - OK
SZ_ERROR_DATA - Data error
SZ_ERROR_MEM - Memory allocation arror
SZ_ERROR_UNSUPPORTED - Unsupported properties
SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer (src)
*/
MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, SizeT *srcLen,
const unsigned char *props, size_t propsSize);
EXTERN_C_END
#endif
/*** End of inlined file: LzmaLib.h ***/
#ifdef LZMA_C_DEFINE
/*** Start of inlined file: Alloc.c ***/
//#include <stdio.h>
//
//#ifdef _WIN32
//#include <windows.h>
//#endif
//#include <stdlib.h>
/* #define _SZ_ALLOC_DEBUG */
/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */
#ifdef _SZ_ALLOC_DEBUG
#include <stdio.h>
int g_allocCount = 0;
int g_allocCountMid = 0;
int g_allocCountBig = 0;
#define CONVERT_INT_TO_STR(charType, tempSize) \
unsigned char temp[tempSize]; unsigned i = 0; \
while (val >= 10) { temp[i++] = (unsigned char)('0' + (unsigned)(val % 10)); val /= 10; } \
*s++ = (charType)('0' + (unsigned)val); \
while (i != 0) { i--; *s++ = temp[i]; } \
*s = 0;
static void ConvertUInt64ToString(UInt64 val, char *s)
{
CONVERT_INT_TO_STR(char, 24);
}
#define GET_HEX_CHAR(t) ((char)(((t < 10) ? ('0' + t) : ('A' + (t - 10)))))
static void ConvertUInt64ToHex(UInt64 val, char *s)
{
UInt64 v = val;
unsigned i;
for (i = 1;; i++)
{
v >>= 4;
if (v == 0)
break;
}
s[i] = 0;
do
{
unsigned t = (unsigned)(val & 0xF);
val >>= 4;
s[--i] = GET_HEX_CHAR(t);
}
while (i);
}
#define DEBUG_OUT_STREAM stderr
static void Print(const char *s)
{
fputs(s, DEBUG_OUT_STREAM);
}
static void PrintAligned(const char *s, size_t align)
{
size_t len = strlen(s);
for(;;)
{
fputc(' ', DEBUG_OUT_STREAM);
if (len >= align)
break;
++len;
}
Print(s);
}
static void PrintLn()
{
Print("\n");
}
static void PrintHex(UInt64 v, size_t align)
{
char s[32];
ConvertUInt64ToHex(v, s);
PrintAligned(s, align);
}
static void PrintDec(UInt64 v, size_t align)
{
char s[32];
ConvertUInt64ToString(v, s);
PrintAligned(s, align);
}
static void PrintAddr(void *p)
{
PrintHex((UInt64)(size_t)(ptrdiff_t)p, 12);
}
#define PRINT_ALLOC(name, cnt, size, ptr) \
Print(name " "); \
PrintDec(cnt++, 10); \
PrintHex(size, 10); \
PrintAddr(ptr); \
PrintLn();
#define PRINT_FREE(name, cnt, ptr) if (ptr) { \
Print(name " "); \
PrintDec(--cnt, 10); \
PrintAddr(ptr); \
PrintLn(); }
#else
#define PRINT_ALLOC(name, cnt, size, ptr)
#define PRINT_FREE(name, cnt, ptr)
#define Print(s)
#define PrintLn()
#define PrintHex(v, align)
#define PrintDec(v, align)
#define PrintAddr(p)
#endif
void *MyAlloc(size_t size)
{
if (size == 0)
return NULL;
#ifdef _SZ_ALLOC_DEBUG
{
void *p = malloc(size);
PRINT_ALLOC("Alloc ", g_allocCount, size, p);
return p;
}
#else
return malloc(size);
#endif
}
void MyFree(void *address)
{
PRINT_FREE("Free ", g_allocCount, address);
free(address);
}
#ifdef _WIN32
void *MidAlloc(size_t size)
{
if (size == 0)
return NULL;
PRINT_ALLOC("Alloc-Mid", g_allocCountMid, size, NULL);
return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE);
}
void MidFree(void *address)
{
PRINT_FREE("Free-Mid", g_allocCountMid, address);
if (!address)
return;
VirtualFree(address, 0, MEM_RELEASE);
}
#ifndef MEM_LARGE_PAGES
#undef _7ZIP_LARGE_PAGES
#endif
#ifdef _7ZIP_LARGE_PAGES
SIZE_T g_LargePageSize = 0;
typedef SIZE_T (WINAPI *GetLargePageMinimumP)();
#endif
void SetLargePageSize()
{
#ifdef _7ZIP_LARGE_PAGES
SIZE_T size;
GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP)
GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum");
if (!largePageMinimum)
return;
size = largePageMinimum();
if (size == 0 || (size & (size - 1)) != 0)
return;
g_LargePageSize = size;
#endif
}
void *BigAlloc(size_t size)
{
if (size == 0)
return NULL;
PRINT_ALLOC("Alloc-Big", g_allocCountBig, size, NULL);
#ifdef _7ZIP_LARGE_PAGES
{
SIZE_T ps = g_LargePageSize;
if (ps != 0 && ps <= (1 << 30) && size > (ps / 2))
{
size_t size2;
ps--;
size2 = (size + ps) & ~ps;
if (size2 >= size)
{
void *res = VirtualAlloc(NULL, size2, MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE);
if (res)
return res;
}
}
}
#endif
return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE);
}
void BigFree(void *address)
{
PRINT_FREE("Free-Big", g_allocCountBig, address);
if (!address)
return;
VirtualFree(address, 0, MEM_RELEASE);
}
#endif
static void *SzAlloc(ISzAllocPtr p, size_t size) { UNUSED_VAR(p); return MyAlloc(size); }
static void SzFree(ISzAllocPtr p, void *address) { UNUSED_VAR(p); MyFree(address); }
const ISzAlloc g_Alloc = { SzAlloc, SzFree };
static void *SzMidAlloc(ISzAllocPtr p, size_t size) { UNUSED_VAR(p); return MidAlloc(size); }
static void SzMidFree(ISzAllocPtr p, void *address) { UNUSED_VAR(p); MidFree(address); }
const ISzAlloc g_MidAlloc = { SzMidAlloc, SzMidFree };
static void *SzBigAlloc(ISzAllocPtr p, size_t size) { UNUSED_VAR(p); return BigAlloc(size); }
static void SzBigFree(ISzAllocPtr p, void *address) { UNUSED_VAR(p); BigFree(address); }
const ISzAlloc g_BigAlloc = { SzBigAlloc, SzBigFree };
/*
uintptr_t : <stdint.h> C99 (optional)
: unsupported in VS6
*/
#ifdef _WIN32
typedef UINT_PTR UIntPtr;
#else
/*
typedef uintptr_t UIntPtr;
*/
typedef ptrdiff_t UIntPtr;
#endif
#define ADJUST_ALLOC_SIZE 0
/*
#define ADJUST_ALLOC_SIZE (sizeof(void *) - 1)
*/
/*
Use (ADJUST_ALLOC_SIZE = (sizeof(void *) - 1)), if
MyAlloc() can return address that is NOT multiple of sizeof(void *).
*/
/*
#define MY_ALIGN_PTR_DOWN(p, align) ((void *)((char *)(p) - ((size_t)(UIntPtr)(p) & ((align) - 1))))
*/
#define MY_ALIGN_PTR_DOWN(p, align) ((void *)((((UIntPtr)(p)) & ~((UIntPtr)(align) - 1))))
#define MY_ALIGN_PTR_UP_PLUS(p, align) MY_ALIGN_PTR_DOWN(((char *)(p) + (align) + ADJUST_ALLOC_SIZE), align)
#if (_POSIX_C_SOURCE >= 200112L) && !defined(_WIN32)
#define USE_posix_memalign
#endif
/*
This posix_memalign() is for test purposes only.
We also need special Free() function instead of free(),
if this posix_memalign() is used.
*/
/*
static int posix_memalign(void **ptr, size_t align, size_t size)
{
size_t newSize = size + align;
void *p;
void *pAligned;
*ptr = NULL;
if (newSize < size)
return 12; // ENOMEM
p = MyAlloc(newSize);
if (!p)
return 12; // ENOMEM
pAligned = MY_ALIGN_PTR_UP_PLUS(p, align);
((void **)pAligned)[-1] = p;
*ptr = pAligned;
return 0;
}
*/
/*
ALLOC_ALIGN_SIZE >= sizeof(void *)
ALLOC_ALIGN_SIZE >= cache_line_size
*/
#define ALLOC_ALIGN_SIZE ((size_t)1 << 7)
static void *SzAlignedAlloc(ISzAllocPtr pp, size_t size)
{
#ifndef USE_posix_memalign
void *p;
void *pAligned;
size_t newSize;
UNUSED_VAR(pp);
/* also we can allocate additional dummy ALLOC_ALIGN_SIZE bytes after aligned
block to prevent cache line sharing with another allocated blocks */
newSize = size + ALLOC_ALIGN_SIZE * 1 + ADJUST_ALLOC_SIZE;
if (newSize < size)
return NULL;
p = MyAlloc(newSize);
if (!p)
return NULL;
pAligned = MY_ALIGN_PTR_UP_PLUS(p, ALLOC_ALIGN_SIZE);
Print(" size="); PrintHex(size, 8);
Print(" a_size="); PrintHex(newSize, 8);
Print(" ptr="); PrintAddr(p);
Print(" a_ptr="); PrintAddr(pAligned);
PrintLn();
((void **)pAligned)[-1] = p;
return pAligned;
#else
void *p;
UNUSED_VAR(pp);
if (posix_memalign(&p, ALLOC_ALIGN_SIZE, size))
return NULL;
Print(" posix_memalign="); PrintAddr(p);
PrintLn();
return p;
#endif
}
static void SzAlignedFree(ISzAllocPtr pp, void *address)
{
UNUSED_VAR(pp);
#ifndef USE_posix_memalign
if (address)
MyFree(((void **)address)[-1]);
#else
free(address);
#endif
}
const ISzAlloc g_AlignedAlloc = { SzAlignedAlloc, SzAlignedFree };
#define MY_ALIGN_PTR_DOWN_1(p) MY_ALIGN_PTR_DOWN(p, sizeof(void *))
/* we align ptr to support cases where CAlignOffsetAlloc::offset is not multiply of sizeof(void *) */
#define REAL_BLOCK_PTR_VAR(p) ((void **)MY_ALIGN_PTR_DOWN_1(p))[-1]
/*
#define REAL_BLOCK_PTR_VAR(p) ((void **)(p))[-1]
*/
static void *AlignOffsetAlloc_Alloc(ISzAllocPtr pp, size_t size)
{
CAlignOffsetAlloc *p = CONTAINER_FROM_VTBL(pp, CAlignOffsetAlloc, vt);
void *adr;
void *pAligned;
size_t newSize;
size_t extra;
size_t alignSize = (size_t)1 << p->numAlignBits;
if (alignSize < sizeof(void *))
alignSize = sizeof(void *);
if (p->offset >= alignSize)
return NULL;
/* also we can allocate additional dummy ALLOC_ALIGN_SIZE bytes after aligned
block to prevent cache line sharing with another allocated blocks */
extra = p->offset & (sizeof(void *) - 1);
newSize = size + alignSize + extra + ADJUST_ALLOC_SIZE;
if (newSize < size)
return NULL;
adr = ISzAlloc_Alloc(p->baseAlloc, newSize);
if (!adr)
return NULL;
pAligned = (char *)MY_ALIGN_PTR_DOWN((char *)adr +
alignSize - p->offset + extra + ADJUST_ALLOC_SIZE, alignSize) + p->offset;
PrintLn();
Print("- Aligned: ");
Print(" size="); PrintHex(size, 8);
Print(" a_size="); PrintHex(newSize, 8);
Print(" ptr="); PrintAddr(adr);
Print(" a_ptr="); PrintAddr(pAligned);
PrintLn();
REAL_BLOCK_PTR_VAR(pAligned) = adr;
return pAligned;
}
static void AlignOffsetAlloc_Free(ISzAllocPtr pp, void *address)
{
if (address)
{
CAlignOffsetAlloc *p = CONTAINER_FROM_VTBL(pp, CAlignOffsetAlloc, vt);
PrintLn();
Print("- Aligned Free: ");
PrintLn();
ISzAlloc_Free(p->baseAlloc, REAL_BLOCK_PTR_VAR(address));
}
}
void AlignOffsetAlloc_CreateVTable(CAlignOffsetAlloc *p)
{
p->vt.Alloc = AlignOffsetAlloc_Alloc;
p->vt.Free = AlignOffsetAlloc_Free;
}
/*** End of inlined file: Alloc.c ***/
/*** Start of inlined file: LzmaDec.c ***/
//#include <string.h>
/* #include "CpuArch.h" */
#define kNumTopBits 24
#define kTopValue ((UInt32)1 << kNumTopBits)
#define kNumBitModelTotalBits 11
#define kBitModelTotal (1 << kNumBitModelTotalBits)
#define kNumMoveBits 5
#define RC_INIT_SIZE 5
#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }
#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * (UInt32)ttt; if (code < bound)
#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits));
#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \
{ UPDATE_0(p); i = (i + i); A0; } else \
{ UPDATE_1(p); i = (i + i) + 1; A1; }
#define TREE_GET_BIT(probs, i) { GET_BIT2(probs + i, i, ;, ;); }
#define REV_BIT(p, i, A0, A1) IF_BIT_0(p + i) \
{ UPDATE_0(p + i); A0; } else \
{ UPDATE_1(p + i); A1; }
#define REV_BIT_VAR( p, i, m) REV_BIT(p, i, i += m; m += m, m += m; i += m; )
#define REV_BIT_CONST(p, i, m) REV_BIT(p, i, i += m; , i += m * 2; )
#define REV_BIT_LAST( p, i, m) REV_BIT(p, i, i -= m , ; )
#define TREE_DECODE(probs, limit, i) \
{ i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }
/* #define _LZMA_SIZE_OPT */
#ifdef _LZMA_SIZE_OPT
#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)
#else
#define TREE_6_DECODE(probs, i) \
{ i = 1; \
TREE_GET_BIT(probs, i); \
TREE_GET_BIT(probs, i); \
TREE_GET_BIT(probs, i); \
TREE_GET_BIT(probs, i); \
TREE_GET_BIT(probs, i); \
TREE_GET_BIT(probs, i); \
i -= 0x40; }
#endif
#define NORMAL_LITER_DEC TREE_GET_BIT(prob, symbol)
#define MATCHED_LITER_DEC \
matchByte += matchByte; \
bit = offs; \
offs &= matchByte; \
probLit = prob + (offs + bit + symbol); \
GET_BIT2(probLit, symbol, offs ^= bit; , ;)
#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }
#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * (UInt32)ttt; if (code < bound)
#define UPDATE_0_CHECK range = bound;
#define UPDATE_1_CHECK range -= bound; code -= bound;
#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \
{ UPDATE_0_CHECK; i = (i + i); A0; } else \
{ UPDATE_1_CHECK; i = (i + i) + 1; A1; }
#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)
#define TREE_DECODE_CHECK(probs, limit, i) \
{ i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }
#define REV_BIT_CHECK(p, i, m) IF_BIT_0_CHECK(p + i) \
{ UPDATE_0_CHECK; i += m; m += m; } else \
{ UPDATE_1_CHECK; m += m; i += m; }
#define kNumPosBitsMax 4
#define kNumPosStatesMax (1 << kNumPosBitsMax)
#define kLenNumLowBits 3
#define kLenNumLowSymbols (1 << kLenNumLowBits)
#define kLenNumHighBits 8
#define kLenNumHighSymbols (1 << kLenNumHighBits)
#define LenLow 0
#define LenHigh (LenLow + 2 * (kNumPosStatesMax << kLenNumLowBits))
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
#define LenChoice LenLow
#define LenChoice2 (LenLow + (1 << kLenNumLowBits))
#define kNumStates 12
#define kNumStates2 16
#define kNumLitStates 7
#define kStartPosModelIndex 4
#define kEndPosModelIndex 14
#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
#define kNumPosSlotBits 6
#define kNumLenToPosStates 4
#define kNumAlignBits 4
#define kAlignTableSize (1 << kNumAlignBits)
#define kMatchMinLen 2
#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols * 2 + kLenNumHighSymbols)
/* External ASM code needs same CLzmaProb array layout. So don't change it. */
/* (probs_1664) is faster and better for code size at some platforms */
/*
#ifdef MY_CPU_X86_OR_AMD64
*/
#define kStartOffset 1664
#define GET_PROBS p->probs_1664
/*
#define GET_PROBS p->probs + kStartOffset
#else
#define kStartOffset 0
#define GET_PROBS p->probs
#endif
*/
#define SpecPos (-kStartOffset)
#define IsRep0Long (SpecPos + kNumFullDistances)
#define RepLenCoder (IsRep0Long + (kNumStates2 << kNumPosBitsMax))
#define LenCoder (RepLenCoder + kNumLenProbs)
#define IsMatch (LenCoder + kNumLenProbs)
#define Align (IsMatch + (kNumStates2 << kNumPosBitsMax))
#define IsRep (Align + kAlignTableSize)
#define IsRepG0 (IsRep + kNumStates)
#define IsRepG1 (IsRepG0 + kNumStates)
#define IsRepG2 (IsRepG1 + kNumStates)
#define PosSlot (IsRepG2 + kNumStates)
#define Literal (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
#define NUM_BASE_PROBS (Literal + kStartOffset)
#if Align != 0 && kStartOffset != 0
#error Stop_Compiling_Bad_LZMA_kAlign
#endif
#if NUM_BASE_PROBS != 1984
#error Stop_Compiling_Bad_LZMA_PROBS
#endif
#define LZMA_LIT_SIZE 0x300
#define LzmaProps_GetNumProbs(p) (NUM_BASE_PROBS + ((UInt32)LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
#define CALC_POS_STATE(processedPos, pbMask) (((processedPos) & (pbMask)) << 4)
#define COMBINED_PS_STATE (posState + state)
#define GET_LEN_STATE (posState)
#define LZMA_DIC_MIN (1 << 12)
/*
p->remainLen : shows status of LZMA decoder:
< kMatchSpecLenStart : normal remain
= kMatchSpecLenStart : finished
= kMatchSpecLenStart + 1 : need init range coder
= kMatchSpecLenStart + 2 : need init range coder and state
*/
/* ---------- LZMA_DECODE_REAL ---------- */
/*
LzmaDec_DecodeReal_3() can be implemented in external ASM file.
3 - is the code compatibility version of that function for check at link time.
*/
#define LZMA_DECODE_REAL LzmaDec_DecodeReal_3
/*
LZMA_DECODE_REAL()
In:
RangeCoder is normalized
if (p->dicPos == limit)
{
LzmaDec_TryDummy() was called before to exclude LITERAL and MATCH-REP cases.
So first symbol can be only MATCH-NON-REP. And if that MATCH-NON-REP symbol
is not END_OF_PAYALOAD_MARKER, then function returns error code.
}
Processing:
first LZMA symbol will be decoded in any case
All checks for limits are at the end of main loop,
It will decode new LZMA-symbols while (p->buf < bufLimit && dicPos < limit),
RangeCoder is still without last normalization when (p->buf < bufLimit) is being checked.
Out:
RangeCoder is normalized
Result:
SZ_OK - OK
SZ_ERROR_DATA - Error
p->remainLen:
< kMatchSpecLenStart : normal remain
= kMatchSpecLenStart : finished
*/
#ifdef _LZMA_DEC_OPT
int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit);
#else
static
int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
{
CLzmaProb *probs = GET_PROBS;
unsigned state = (unsigned)p->state;
UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3];
unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1;
unsigned lc = p->prop.lc;
unsigned lpMask = ((unsigned)0x100 << p->prop.lp) - ((unsigned)0x100 >> lc);
Byte *dic = p->dic;
SizeT dicBufSize = p->dicBufSize;
SizeT dicPos = p->dicPos;
UInt32 processedPos = p->processedPos;
UInt32 checkDicSize = p->checkDicSize;
unsigned len = 0;
const Byte *buf = p->buf;
UInt32 range = p->range;
UInt32 code = p->code;
do
{
CLzmaProb *prob;
UInt32 bound;
unsigned ttt;
unsigned posState = CALC_POS_STATE(processedPos, pbMask);
prob = probs + IsMatch + COMBINED_PS_STATE;
IF_BIT_0(prob)
{
unsigned symbol;
UPDATE_0(prob);
prob = probs + Literal;
if (processedPos != 0 || checkDicSize != 0)
prob += (UInt32)3 * ((((processedPos << 8) + dic[(dicPos == 0 ? dicBufSize : dicPos) - 1]) & lpMask) << lc);
processedPos++;
if (state < kNumLitStates)
{
state -= (state < 4) ? state : 3;
symbol = 1;
#ifdef _LZMA_SIZE_OPT
do { NORMAL_LITER_DEC } while (symbol < 0x100);
#else
NORMAL_LITER_DEC
NORMAL_LITER_DEC
NORMAL_LITER_DEC
NORMAL_LITER_DEC
NORMAL_LITER_DEC
NORMAL_LITER_DEC
NORMAL_LITER_DEC
NORMAL_LITER_DEC
#endif
}
else
{
unsigned matchByte = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)];
unsigned offs = 0x100;
state -= (state < 10) ? 3 : 6;
symbol = 1;
#ifdef _LZMA_SIZE_OPT
do
{
unsigned bit;
CLzmaProb *probLit;
MATCHED_LITER_DEC
}
while (symbol < 0x100);
#else
{
unsigned bit;
CLzmaProb *probLit;
MATCHED_LITER_DEC
MATCHED_LITER_DEC
MATCHED_LITER_DEC
MATCHED_LITER_DEC
MATCHED_LITER_DEC
MATCHED_LITER_DEC
MATCHED_LITER_DEC
MATCHED_LITER_DEC
}
#endif
}
dic[dicPos++] = (Byte)symbol;
continue;
}
{
UPDATE_1(prob);
prob = probs + IsRep + state;
IF_BIT_0(prob)
{
UPDATE_0(prob);
state += kNumStates;
prob = probs + LenCoder;
}
else
{
UPDATE_1(prob);
/*
// that case was checked before with kBadRepCode
if (checkDicSize == 0 && processedPos == 0)
return SZ_ERROR_DATA;
*/
prob = probs + IsRepG0 + state;
IF_BIT_0(prob)
{
UPDATE_0(prob);
prob = probs + IsRep0Long + COMBINED_PS_STATE;
IF_BIT_0(prob)
{
UPDATE_0(prob);
dic[dicPos] = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)];
dicPos++;
processedPos++;
state = state < kNumLitStates ? 9 : 11;
continue;
}
UPDATE_1(prob);
}
else
{
UInt32 distance;
UPDATE_1(prob);
prob = probs + IsRepG1 + state;
IF_BIT_0(prob)
{
UPDATE_0(prob);
distance = rep1;
}
else
{
UPDATE_1(prob);
prob = probs + IsRepG2 + state;
IF_BIT_0(prob)
{
UPDATE_0(prob);
distance = rep2;
}
else
{
UPDATE_1(prob);
distance = rep3;
rep3 = rep2;
}
rep2 = rep1;
}
rep1 = rep0;
rep0 = distance;
}
state = state < kNumLitStates ? 8 : 11;
prob = probs + RepLenCoder;
}
#ifdef _LZMA_SIZE_OPT
{
unsigned lim, offset;
CLzmaProb *probLen = prob + LenChoice;
IF_BIT_0(probLen)
{
UPDATE_0(probLen);
probLen = prob + LenLow + GET_LEN_STATE;
offset = 0;
lim = (1 << kLenNumLowBits);
}
else
{
UPDATE_1(probLen);
probLen = prob + LenChoice2;
IF_BIT_0(probLen)
{
UPDATE_0(probLen);
probLen = prob + LenLow + GET_LEN_STATE + (1 << kLenNumLowBits);
offset = kLenNumLowSymbols;
lim = (1 << kLenNumLowBits);
}
else
{
UPDATE_1(probLen);
probLen = prob + LenHigh;
offset = kLenNumLowSymbols * 2;
lim = (1 << kLenNumHighBits);
}
}
TREE_DECODE(probLen, lim, len);
len += offset;
}
#else
{
CLzmaProb *probLen = prob + LenChoice;
IF_BIT_0(probLen)
{
UPDATE_0(probLen);
probLen = prob + LenLow + GET_LEN_STATE;
len = 1;
TREE_GET_BIT(probLen, len);
TREE_GET_BIT(probLen, len);
TREE_GET_BIT(probLen, len);
len -= 8;
}
else
{
UPDATE_1(probLen);
probLen = prob + LenChoice2;
IF_BIT_0(probLen)
{
UPDATE_0(probLen);
probLen = prob + LenLow + GET_LEN_STATE + (1 << kLenNumLowBits);
len = 1;
TREE_GET_BIT(probLen, len);
TREE_GET_BIT(probLen, len);
TREE_GET_BIT(probLen, len);
}
else
{
UPDATE_1(probLen);
probLen = prob + LenHigh;
TREE_DECODE(probLen, (1 << kLenNumHighBits), len);
len += kLenNumLowSymbols * 2;
}
}
}
#endif
if (state >= kNumStates)
{
UInt32 distance;
prob = probs + PosSlot +
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits);
TREE_6_DECODE(prob, distance);
if (distance >= kStartPosModelIndex)
{
unsigned posSlot = (unsigned)distance;
unsigned numDirectBits = (unsigned)(((distance >> 1) - 1));
distance = (2 | (distance & 1));
if (posSlot < kEndPosModelIndex)
{
distance <<= numDirectBits;
prob = probs + SpecPos;
{
UInt32 m = 1;
distance++;
do
{
REV_BIT_VAR(prob, distance, m);
}
while (--numDirectBits);
distance -= m;
}
}
else
{
numDirectBits -= kNumAlignBits;
do
{
NORMALIZE
range >>= 1;
{
UInt32 t;
code -= range;
t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */
distance = (distance << 1) + (t + 1);
code += range & t;
}
/*
distance <<= 1;
if (code >= range)
{
code -= range;
distance |= 1;
}
*/
}
while (--numDirectBits);
prob = probs + Align;
distance <<= kNumAlignBits;
{
unsigned i = 1;
REV_BIT_CONST(prob, i, 1);
REV_BIT_CONST(prob, i, 2);
REV_BIT_CONST(prob, i, 4);
REV_BIT_LAST (prob, i, 8);
distance |= i;
}
if (distance == (UInt32)0xFFFFFFFF)
{
len = kMatchSpecLenStart;
state -= kNumStates;
break;
}
}
}
rep3 = rep2;
rep2 = rep1;
rep1 = rep0;
rep0 = distance + 1;
state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3;
if (distance >= (checkDicSize == 0 ? processedPos: checkDicSize))
{
p->dicPos = dicPos;
return SZ_ERROR_DATA;
}
}
len += kMatchMinLen;
{
SizeT rem;
unsigned curLen;
SizeT pos;
if ((rem = limit - dicPos) == 0)
{
p->dicPos = dicPos;
return SZ_ERROR_DATA;
}
curLen = ((rem < len) ? (unsigned)rem : len);
pos = dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0);
processedPos += (UInt32)curLen;
len -= curLen;
if (curLen <= dicBufSize - pos)
{
Byte *dest = dic + dicPos;
ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos;
const Byte *lim = dest + curLen;
dicPos += (SizeT)curLen;
do
*(dest) = (Byte)*(dest + src);
while (++dest != lim);
}
else
{
do
{
dic[dicPos++] = dic[pos];
if (++pos == dicBufSize)
pos = 0;
}
while (--curLen != 0);
}
}
}
}
while (dicPos < limit && buf < bufLimit);
NORMALIZE;
p->buf = buf;
p->range = range;
p->code = code;
p->remainLen = (UInt32)len;
p->dicPos = dicPos;
p->processedPos = processedPos;
p->reps[0] = rep0;
p->reps[1] = rep1;
p->reps[2] = rep2;
p->reps[3] = rep3;
p->state = (UInt32)state;
return SZ_OK;
}
#endif
static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit)
{
if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart)
{
Byte *dic = p->dic;
SizeT dicPos = p->dicPos;
SizeT dicBufSize = p->dicBufSize;
unsigned len = (unsigned)p->remainLen;
SizeT rep0 = p->reps[0]; /* we use SizeT to avoid the BUG of VC14 for AMD64 */
SizeT rem = limit - dicPos;
if (rem < len)
len = (unsigned)(rem);
if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len)
p->checkDicSize = p->prop.dicSize;
p->processedPos += (UInt32)len;
p->remainLen -= (UInt32)len;
while (len != 0)
{
len--;
dic[dicPos] = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)];
dicPos++;
}
p->dicPos = dicPos;
}
}
#define kRange0 0xFFFFFFFF
#define kBound0 ((kRange0 >> kNumBitModelTotalBits) << (kNumBitModelTotalBits - 1))
#define kBadRepCode (kBound0 + (((kRange0 - kBound0) >> kNumBitModelTotalBits) << (kNumBitModelTotalBits - 1)))
#if kBadRepCode != (0xC0000000 - 0x400)
#error Stop_Compiling_Bad_LZMA_Check
#endif
static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
{
do
{
SizeT limit2 = limit;
if (p->checkDicSize == 0)
{
UInt32 rem = p->prop.dicSize - p->processedPos;
if (limit - p->dicPos > rem)
limit2 = p->dicPos + rem;
if (p->processedPos == 0)
if (p->code >= kBadRepCode)
return SZ_ERROR_DATA;
}
RINOK(LZMA_DECODE_REAL(p, limit2, bufLimit));
if (p->checkDicSize == 0 && p->processedPos >= p->prop.dicSize)
p->checkDicSize = p->prop.dicSize;
LzmaDec_WriteRem(p, limit);
}
while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart);
return 0;
}
typedef enum
{
DUMMY_ERROR, /* unexpected end of input stream */
DUMMY_LIT,
DUMMY_MATCH,
DUMMY_REP
} ELzmaDummy;
static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize)
{
UInt32 range = p->range;
UInt32 code = p->code;
const Byte *bufLimit = buf + inSize;
const CLzmaProb *probs = GET_PROBS;
unsigned state = (unsigned)p->state;
ELzmaDummy res;
{
const CLzmaProb *prob;
UInt32 bound;
unsigned ttt;
unsigned posState = CALC_POS_STATE(p->processedPos, (1 << p->prop.pb) - 1);
prob = probs + IsMatch + COMBINED_PS_STATE;
IF_BIT_0_CHECK(prob)
{
UPDATE_0_CHECK
/* if (bufLimit - buf >= 7) return DUMMY_LIT; */
prob = probs + Literal;
if (p->checkDicSize != 0 || p->processedPos != 0)
prob += ((UInt32)LZMA_LIT_SIZE *
((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) +
(p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc))));
if (state < kNumLitStates)
{
unsigned symbol = 1;
do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100);
}
else
{
unsigned matchByte = p->dic[p->dicPos - p->reps[0] +
(p->dicPos < p->reps[0] ? p->dicBufSize : 0)];
unsigned offs = 0x100;
unsigned symbol = 1;
do
{
unsigned bit;
const CLzmaProb *probLit;
matchByte += matchByte;
bit = offs;
offs &= matchByte;
probLit = prob + (offs + bit + symbol);
GET_BIT2_CHECK(probLit, symbol, offs ^= bit; , ; )
}
while (symbol < 0x100);
}
res = DUMMY_LIT;
}
else
{
unsigned len;
UPDATE_1_CHECK;
prob = probs + IsRep + state;
IF_BIT_0_CHECK(prob)
{
UPDATE_0_CHECK;
state = 0;
prob = probs + LenCoder;
res = DUMMY_MATCH;
}
else
{
UPDATE_1_CHECK;
res = DUMMY_REP;
prob = probs + IsRepG0 + state;
IF_BIT_0_CHECK(prob)
{
UPDATE_0_CHECK;
prob = probs + IsRep0Long + COMBINED_PS_STATE;
IF_BIT_0_CHECK(prob)
{
UPDATE_0_CHECK;
NORMALIZE_CHECK;
return DUMMY_REP;
}
else
{
UPDATE_1_CHECK;
}
}
else
{
UPDATE_1_CHECK;
prob = probs + IsRepG1 + state;
IF_BIT_0_CHECK(prob)
{
UPDATE_0_CHECK;
}
else
{
UPDATE_1_CHECK;
prob = probs + IsRepG2 + state;
IF_BIT_0_CHECK(prob)
{
UPDATE_0_CHECK;
}
else
{
UPDATE_1_CHECK;
}
}
}
state = kNumStates;
prob = probs + RepLenCoder;
}
{
unsigned limit, offset;
const CLzmaProb *probLen = prob + LenChoice;
IF_BIT_0_CHECK(probLen)
{
UPDATE_0_CHECK;
probLen = prob + LenLow + GET_LEN_STATE;
offset = 0;
limit = 1 << kLenNumLowBits;
}
else
{
UPDATE_1_CHECK;
probLen = prob + LenChoice2;
IF_BIT_0_CHECK(probLen)
{
UPDATE_0_CHECK;
probLen = prob + LenLow + GET_LEN_STATE + (1 << kLenNumLowBits);
offset = kLenNumLowSymbols;
limit = 1 << kLenNumLowBits;
}
else
{
UPDATE_1_CHECK;
probLen = prob + LenHigh;
offset = kLenNumLowSymbols * 2;
limit = 1 << kLenNumHighBits;
}
}
TREE_DECODE_CHECK(probLen, limit, len);
len += offset;
}
if (state < 4)
{
unsigned posSlot;
prob = probs + PosSlot +
((len < kNumLenToPosStates - 1 ? len : kNumLenToPosStates - 1) <<
kNumPosSlotBits);
TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot);
if (posSlot >= kStartPosModelIndex)
{
unsigned numDirectBits = ((posSlot >> 1) - 1);
/* if (bufLimit - buf >= 8) return DUMMY_MATCH; */
if (posSlot < kEndPosModelIndex)
{
prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits);
}
else
{
numDirectBits -= kNumAlignBits;
do
{
NORMALIZE_CHECK
range >>= 1;
code -= range & (((code - range) >> 31) - 1);
/* if (code >= range) code -= range; */
}
while (--numDirectBits);
prob = probs + Align;
numDirectBits = kNumAlignBits;
}
{
unsigned i = 1;
unsigned m = 1;
do
{
REV_BIT_CHECK(prob, i, m);
}
while (--numDirectBits);
}
}
}
}
}
NORMALIZE_CHECK;
return res;
}
void LzmaDec_InitDicAndState(CLzmaDec *p, BoolInt initDic, BoolInt initState)
{
p->remainLen = kMatchSpecLenStart + 1;
p->tempBufSize = 0;
if (initDic)
{
p->processedPos = 0;
p->checkDicSize = 0;
p->remainLen = kMatchSpecLenStart + 2;
}
if (initState)
p->remainLen = kMatchSpecLenStart + 2;
}
void LzmaDec_Init(CLzmaDec *p)
{
p->dicPos = 0;
LzmaDec_InitDicAndState(p, True, True);
}
SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen,
ELzmaFinishMode finishMode, ELzmaStatus *status)
{
SizeT inSize = *srcLen;
(*srcLen) = 0;
*status = LZMA_STATUS_NOT_SPECIFIED;
if (p->remainLen > kMatchSpecLenStart)
{
for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--)
p->tempBuf[p->tempBufSize++] = *src++;
if (p->tempBufSize != 0 && p->tempBuf[0] != 0)
return SZ_ERROR_DATA;
if (p->tempBufSize < RC_INIT_SIZE)
{
*status = LZMA_STATUS_NEEDS_MORE_INPUT;
return SZ_OK;
}
p->code =
((UInt32)p->tempBuf[1] << 24)
| ((UInt32)p->tempBuf[2] << 16)
| ((UInt32)p->tempBuf[3] << 8)
| ((UInt32)p->tempBuf[4]);
p->range = 0xFFFFFFFF;
p->tempBufSize = 0;
if (p->remainLen > kMatchSpecLenStart + 1)
{
SizeT numProbs = LzmaProps_GetNumProbs(&p->prop);
SizeT i;
CLzmaProb *probs = p->probs;
for (i = 0; i < numProbs; i++)
probs[i] = kBitModelTotal >> 1;
p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1;
p->state = 0;
}
p->remainLen = 0;
}
LzmaDec_WriteRem(p, dicLimit);
while (p->remainLen != kMatchSpecLenStart)
{
int checkEndMarkNow = 0;
if (p->dicPos >= dicLimit)
{
if (p->remainLen == 0 && p->code == 0)
{
*status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK;
return SZ_OK;
}
if (finishMode == LZMA_FINISH_ANY)
{
*status = LZMA_STATUS_NOT_FINISHED;
return SZ_OK;
}
if (p->remainLen != 0)
{
*status = LZMA_STATUS_NOT_FINISHED;
return SZ_ERROR_DATA;
}
checkEndMarkNow = 1;
}
if (p->tempBufSize == 0)
{
SizeT processed;
const Byte *bufLimit;
if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
{
int dummyRes = LzmaDec_TryDummy(p, src, inSize);
if (dummyRes == DUMMY_ERROR)
{
memcpy(p->tempBuf, src, inSize);
p->tempBufSize = (unsigned)inSize;
(*srcLen) += inSize;
*status = LZMA_STATUS_NEEDS_MORE_INPUT;
return SZ_OK;
}
if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
{
*status = LZMA_STATUS_NOT_FINISHED;
return SZ_ERROR_DATA;
}
bufLimit = src;
}
else
bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX;
p->buf = src;
if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0)
return SZ_ERROR_DATA;
processed = (SizeT)(p->buf - src);
(*srcLen) += processed;
src += processed;
inSize -= processed;
}
else
{
unsigned rem = p->tempBufSize, lookAhead = 0;
while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize)
p->tempBuf[rem++] = src[lookAhead++];
p->tempBufSize = rem;
if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
{
int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, (SizeT)rem);
if (dummyRes == DUMMY_ERROR)
{
(*srcLen) += (SizeT)lookAhead;
*status = LZMA_STATUS_NEEDS_MORE_INPUT;
return SZ_OK;
}
if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
{
*status = LZMA_STATUS_NOT_FINISHED;
return SZ_ERROR_DATA;
}
}
p->buf = p->tempBuf;
if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0)
return SZ_ERROR_DATA;
{
unsigned kkk = (unsigned)(p->buf - p->tempBuf);
if (rem < kkk)
return SZ_ERROR_FAIL; /* some internal error */
rem -= kkk;
if (lookAhead < rem)
return SZ_ERROR_FAIL; /* some internal error */
lookAhead -= rem;
}
(*srcLen) += (SizeT)lookAhead;
src += lookAhead;
inSize -= (SizeT)lookAhead;
p->tempBufSize = 0;
}
}
if (p->code != 0)
return SZ_ERROR_DATA;
*status = LZMA_STATUS_FINISHED_WITH_MARK;
return SZ_OK;
}
SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
{
SizeT outSize = *destLen;
SizeT inSize = *srcLen;
*srcLen = *destLen = 0;
for (;;)
{
SizeT inSizeCur = inSize, outSizeCur, dicPos;
ELzmaFinishMode curFinishMode;
SRes res;
if (p->dicPos == p->dicBufSize)
p->dicPos = 0;
dicPos = p->dicPos;
if (outSize > p->dicBufSize - dicPos)
{
outSizeCur = p->dicBufSize;
curFinishMode = LZMA_FINISH_ANY;
}
else
{
outSizeCur = dicPos + outSize;
curFinishMode = finishMode;
}
res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status);
src += inSizeCur;
inSize -= inSizeCur;
*srcLen += inSizeCur;
outSizeCur = p->dicPos - dicPos;
memcpy(dest, p->dic + dicPos, outSizeCur);
dest += outSizeCur;
outSize -= outSizeCur;
*destLen += outSizeCur;
if (res != 0)
return res;
if (outSizeCur == 0 || outSize == 0)
return SZ_OK;
}
}
void LzmaDec_FreeProbs(CLzmaDec *p, ISzAllocPtr alloc)
{
ISzAlloc_Free(alloc, p->probs);
p->probs = NULL;
}
static void LzmaDec_FreeDict(CLzmaDec *p, ISzAllocPtr alloc)
{
ISzAlloc_Free(alloc, p->dic);
p->dic = NULL;
}
void LzmaDec_Free(CLzmaDec *p, ISzAllocPtr alloc)
{
LzmaDec_FreeProbs(p, alloc);
LzmaDec_FreeDict(p, alloc);
}
SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)
{
UInt32 dicSize;
Byte d;
if (size < LZMA_PROPS_SIZE)
return SZ_ERROR_UNSUPPORTED;
else
dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24);
if (dicSize < LZMA_DIC_MIN)
dicSize = LZMA_DIC_MIN;
p->dicSize = dicSize;
d = data[0];
if (d >= (9 * 5 * 5))
return SZ_ERROR_UNSUPPORTED;
p->lc = (Byte)(d % 9);
d /= 9;
p->pb = (Byte)(d / 5);
p->lp = (Byte)(d % 5);
return SZ_OK;
}
static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAllocPtr alloc)
{
UInt32 numProbs = LzmaProps_GetNumProbs(propNew);
if (!p->probs || numProbs != p->numProbs)
{
LzmaDec_FreeProbs(p, alloc);
p->probs = (CLzmaProb *)ISzAlloc_Alloc(alloc, numProbs * sizeof(CLzmaProb));
if (!p->probs)
return SZ_ERROR_MEM;
p->probs_1664 = p->probs + 1664;
p->numProbs = numProbs;
}
return SZ_OK;
}
SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc)
{
CLzmaProps propNew;
RINOK(LzmaProps_Decode(&propNew, props, propsSize));
RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));
p->prop = propNew;
return SZ_OK;
}
SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc)
{
CLzmaProps propNew;
SizeT dicBufSize;
RINOK(LzmaProps_Decode(&propNew, props, propsSize));
RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));
{
UInt32 dictSize = propNew.dicSize;
SizeT mask = ((UInt32)1 << 12) - 1;
if (dictSize >= ((UInt32)1 << 30)) mask = ((UInt32)1 << 22) - 1;
else if (dictSize >= ((UInt32)1 << 22)) mask = ((UInt32)1 << 20) - 1;;
dicBufSize = ((SizeT)dictSize + mask) & ~mask;
if (dicBufSize < dictSize)
dicBufSize = dictSize;
}
if (!p->dic || dicBufSize != p->dicBufSize)
{
LzmaDec_FreeDict(p, alloc);
p->dic = (Byte *)ISzAlloc_Alloc(alloc, dicBufSize);
if (!p->dic)
{
LzmaDec_FreeProbs(p, alloc);
return SZ_ERROR_MEM;
}
}
p->dicBufSize = dicBufSize;
p->prop = propNew;
return SZ_OK;
}
SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
ELzmaStatus *status, ISzAllocPtr alloc)
{
CLzmaDec p;
SRes res;
SizeT outSize = *destLen, inSize = *srcLen;
*destLen = *srcLen = 0;
*status = LZMA_STATUS_NOT_SPECIFIED;
if (inSize < RC_INIT_SIZE)
return SZ_ERROR_INPUT_EOF;
LzmaDec_Construct(&p);
RINOK(LzmaDec_AllocateProbs(&p, propData, propSize, alloc));
p.dic = dest;
p.dicBufSize = outSize;
LzmaDec_Init(&p);
*srcLen = inSize;
res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status);
*destLen = p.dicPos;
if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT)
res = SZ_ERROR_INPUT_EOF;
LzmaDec_FreeProbs(&p, alloc);
return res;
}
/*** End of inlined file: LzmaDec.c ***/
/*** Start of inlined file: LzmaEnc.c ***/
//#include <string.h>
/* #define SHOW_STAT */
/* #define SHOW_STAT2 */
//#if defined(SHOW_STAT) || defined(SHOW_STAT2)
//#include <stdio.h>
//#endif
/*** Start of inlined file: LzFind.h ***/
#ifndef __LZ_FIND_H
#define __LZ_FIND_H
EXTERN_C_BEGIN
typedef UInt32 CLzRef;
typedef struct _CMatchFinder
{
Byte *buffer;
UInt32 pos;
UInt32 posLimit;
UInt32 streamPos;
UInt32 lenLimit;
UInt32 cyclicBufferPos;
UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */
Byte streamEndWasReached;
Byte btMode;
Byte bigHash;
Byte directInput;
UInt32 matchMaxLen;
CLzRef *hash;
CLzRef *son;
UInt32 hashMask;
UInt32 cutValue;
Byte *bufferBase;
ISeqInStream *stream;
UInt32 blockSize;
UInt32 keepSizeBefore;
UInt32 keepSizeAfter;
UInt32 numHashBytes;
size_t directInputRem;
UInt32 historySize;
UInt32 fixedHashSize;
UInt32 hashSizeSum;
SRes result;
UInt32 crc[256];
size_t numRefs;
UInt64 expectedDataSize;
} CMatchFinder;
#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer)
#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos)
#define Inline_MatchFinder_IsFinishedOK(p) \
((p)->streamEndWasReached \
&& (p)->streamPos == (p)->pos \
&& (!(p)->directInput || (p)->directInputRem == 0))
int MatchFinder_NeedMove(CMatchFinder *p);
Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p);
void MatchFinder_MoveBlock(CMatchFinder *p);
void MatchFinder_ReadIfRequired(CMatchFinder *p);
void MatchFinder_Construct(CMatchFinder *p);
/* Conditions:
historySize <= 3 GB
keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB
*/
int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
ISzAllocPtr alloc);
void MatchFinder_Free(CMatchFinder *p, ISzAllocPtr alloc);
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems);
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);
UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
UInt32 *distances, UInt32 maxLen);
/*
Conditions:
Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func.
Mf_GetPointerToCurrentPos_Func's result must be used only before any other function
*/
typedef void (*Mf_Init_Func)(void *object);
typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);
typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);
typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances);
typedef void (*Mf_Skip_Func)(void *object, UInt32);
typedef struct _IMatchFinder
{
Mf_Init_Func Init;
Mf_GetNumAvailableBytes_Func GetNumAvailableBytes;
Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos;
Mf_GetMatches_Func GetMatches;
Mf_Skip_Func Skip;
} IMatchFinder;
void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable);
void MatchFinder_Init_LowHash(CMatchFinder *p);
void MatchFinder_Init_HighHash(CMatchFinder *p);
void MatchFinder_Init_3(CMatchFinder *p, int readData);
void MatchFinder_Init(CMatchFinder *p);
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
EXTERN_C_END
#endif
/*** End of inlined file: LzFind.h ***/
#ifdef SHOW_STAT
static unsigned g_STAT_OFFSET = 0;
#endif
#define kLzmaMaxHistorySize ((UInt32)3 << 29)
/* #define kLzmaMaxHistorySize ((UInt32)7 << 29) */
#define kNumTopBits 24
#define kTopValue ((UInt32)1 << kNumTopBits)
#define kNumBitModelTotalBits 11
#define kBitModelTotal (1 << kNumBitModelTotalBits)
#define kNumMoveBits 5
#define kProbInitValue (kBitModelTotal >> 1)
#define kNumMoveReducingBits 4
#define kNumBitPriceShiftBits 4
#define kBitPrice (1 << kNumBitPriceShiftBits)
#define REP_LEN_COUNT 64
void LzmaEncProps_Init(CLzmaEncProps *p)
{
p->level = 5;
p->dictSize = p->mc = 0;
p->reduceSize = (UInt64)(Int64)-1;
p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1;
p->writeEndMark = 0;
}
void LzmaEncProps_Normalize(CLzmaEncProps *p)
{
int level = p->level;
if (level < 0) level = 5;
p->level = level;
if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level <= 7 ? (1 << 25) : (1 << 26)));
if (p->dictSize > p->reduceSize)
{
unsigned i;
UInt32 reduceSize = (UInt32)p->reduceSize;
for (i = 11; i <= 30; i++)
{
if (reduceSize <= ((UInt32)2 << i)) { p->dictSize = ((UInt32)2 << i); break; }
if (reduceSize <= ((UInt32)3 << i)) { p->dictSize = ((UInt32)3 << i); break; }
}
}
if (p->lc < 0) p->lc = 3;
if (p->lp < 0) p->lp = 0;
if (p->pb < 0) p->pb = 2;
if (p->algo < 0) p->algo = (level < 5 ? 0 : 1);
if (p->fb < 0) p->fb = (level < 7 ? 32 : 64);
if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1);
if (p->numHashBytes < 0) p->numHashBytes = 4;
if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1);
if (p->numThreads < 0)
p->numThreads = 1;
}
UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2)
{
CLzmaEncProps props = *props2;
LzmaEncProps_Normalize(&props);
return props.dictSize;
}
#if (_MSC_VER >= 1400)
/* BSR code is fast for some new CPUs */
/* #define LZMA_LOG_BSR */
#endif
#ifdef LZMA_LOG_BSR
#define kDicLogSizeMaxCompress 32
#define BSR2_RET(pos, res) { unsigned long zz; _BitScanReverse(&zz, (pos)); res = (zz + zz) + ((pos >> (zz - 1)) & 1); }
static unsigned GetPosSlot1(UInt32 pos)
{
unsigned res;
BSR2_RET(pos, res);
return res;
}
#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); }
#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); }
#else
#define kNumLogBits (9 + sizeof(size_t) / 2)
/* #define kNumLogBits (11 + sizeof(size_t) / 8 * 3) */
#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7)
static void LzmaEnc_FastPosInit(Byte *g_FastPos)
{
unsigned slot;
g_FastPos[0] = 0;
g_FastPos[1] = 1;
g_FastPos += 2;
for (slot = 2; slot < kNumLogBits * 2; slot++)
{
size_t k = ((size_t)1 << ((slot >> 1) - 1));
size_t j;
for (j = 0; j < k; j++)
g_FastPos[j] = (Byte)slot;
g_FastPos += k;
}
}
/* we can use ((limit - pos) >> 31) only if (pos < ((UInt32)1 << 31)) */
/*
#define BSR2_RET(pos, res) { unsigned zz = 6 + ((kNumLogBits - 1) & \
(0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \
res = p->g_FastPos[pos >> zz] + (zz * 2); }
*/
/*
#define BSR2_RET(pos, res) { unsigned zz = 6 + ((kNumLogBits - 1) & \
(0 - (((((UInt32)1 << (kNumLogBits)) - 1) - (pos >> 6)) >> 31))); \
res = p->g_FastPos[pos >> zz] + (zz * 2); }
*/
#define BSR2_RET(pos, res) { unsigned zz = (pos < (1 << (kNumLogBits + 6))) ? 6 : 6 + kNumLogBits - 1; \
res = p->g_FastPos[pos >> zz] + (zz * 2); }
/*
#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \
p->g_FastPos[pos >> 6] + 12 : \
p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; }
*/
#define GetPosSlot1(pos) p->g_FastPos[pos]
#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); }
#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos & (kNumFullDistances - 1)]; else BSR2_RET(pos, res); }
#endif
#define LZMA_NUM_REPS 4
typedef UInt16 CState;
typedef UInt16 CExtra;
typedef struct
{
UInt32 price;
CState state;
CExtra extra;
// 0 : normal
// 1 : LIT : MATCH
// > 1 : MATCH (extra-1) : LIT : REP0 (len)
UInt32 len;
UInt32 dist;
UInt32 reps[LZMA_NUM_REPS];
} COptimal;
// 18.06
#define kNumOpts (1 << 11)
#define kPackReserve (kNumOpts * 8)
// #define kNumOpts (1 << 12)
// #define kPackReserve (1 + kNumOpts * 2)
#define kNumLenToPosStates 4
#define kNumPosSlotBits 6
#define kDicLogSizeMin 0
#define kDicLogSizeMax 32
#define kDistTableSizeMax (kDicLogSizeMax * 2)
#define kNumAlignBits 4
#define kAlignTableSize (1 << kNumAlignBits)
#define kAlignMask (kAlignTableSize - 1)
#define kStartPosModelIndex 4
#define kEndPosModelIndex 14
#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
typedef
#ifdef _LZMA_PROB32
UInt32
#else
UInt16
#endif
CLzmaProb;
#define LZMA_PB_MAX 4
#define LZMA_LC_MAX 8
#define LZMA_LP_MAX 4
#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX)
#define kLenNumLowBits 3
#define kLenNumLowSymbols (1 << kLenNumLowBits)
#define kLenNumHighBits 8
#define kLenNumHighSymbols (1 << kLenNumHighBits)
#define kLenNumSymbolsTotal (kLenNumLowSymbols * 2 + kLenNumHighSymbols)
#define LZMA_MATCH_LEN_MIN 2
#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1)
#define kNumStates 12
typedef struct
{
CLzmaProb low[LZMA_NUM_PB_STATES_MAX << (kLenNumLowBits + 1)];
CLzmaProb high[kLenNumHighSymbols];
} CLenEnc;
typedef struct
{
unsigned tableSize;
UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal];
// UInt32 prices1[LZMA_NUM_PB_STATES_MAX][kLenNumLowSymbols * 2];
// UInt32 prices2[kLenNumSymbolsTotal];
} CLenPriceEnc;
#define GET_PRICE_LEN(p, posState, len) \
((p)->prices[posState][(size_t)(len) - LZMA_MATCH_LEN_MIN])
/*
#define GET_PRICE_LEN(p, posState, len) \
((p)->prices2[(size_t)(len) - 2] + ((p)->prices1[posState][((len) - 2) & (kLenNumLowSymbols * 2 - 1)] & (((len) - 2 - kLenNumLowSymbols * 2) >> 9)))
*/
typedef struct
{
UInt32 range;
unsigned cache;
UInt64 low;
UInt64 cacheSize;
Byte *buf;
Byte *bufLim;
Byte *bufBase;
ISeqOutStream *outStream;
UInt64 processed;
SRes res;
} CRangeEnc;
typedef struct
{
CLzmaProb *litProbs;
unsigned state;
UInt32 reps[LZMA_NUM_REPS];
CLzmaProb posAlignEncoder[1 << kNumAlignBits];
CLzmaProb isRep[kNumStates];
CLzmaProb isRepG0[kNumStates];
CLzmaProb isRepG1[kNumStates];
CLzmaProb isRepG2[kNumStates];
CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX];
CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX];
CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits];
CLzmaProb posEncoders[kNumFullDistances];
CLenEnc lenProbs;
CLenEnc repLenProbs;
} CSaveState;
typedef UInt32 CProbPrice;
typedef struct
{
void *matchFinderObj;
IMatchFinder matchFinder;
unsigned optCur;
unsigned optEnd;
unsigned longestMatchLen;
unsigned numPairs;
UInt32 numAvail;
unsigned state;
unsigned numFastBytes;
unsigned additionalOffset;
UInt32 reps[LZMA_NUM_REPS];
unsigned lpMask, pbMask;
CLzmaProb *litProbs;
CRangeEnc rc;
UInt32 backRes;
unsigned lc, lp, pb;
unsigned lclp;
BoolInt fastMode;
BoolInt writeEndMark;
BoolInt finished;
BoolInt multiThread;
BoolInt needInit;
// BoolInt _maxMode;
UInt64 nowPos64;
unsigned matchPriceCount;
// unsigned alignPriceCount;
int repLenEncCounter;
unsigned distTableSize;
UInt32 dictSize;
SRes result;
CMatchFinder matchFinderBase;
// LZ thread
CProbPrice ProbPrices[kBitModelTotal >> kNumMoveReducingBits];
UInt32 matches[LZMA_MATCH_LEN_MAX * 2 + 2 + 1];
UInt32 alignPrices[kAlignTableSize];
UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax];
UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances];
CLzmaProb posAlignEncoder[1 << kNumAlignBits];
CLzmaProb isRep[kNumStates];
CLzmaProb isRepG0[kNumStates];
CLzmaProb isRepG1[kNumStates];
CLzmaProb isRepG2[kNumStates];
CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX];
CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX];
CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits];
CLzmaProb posEncoders[kNumFullDistances];
CLenEnc lenProbs;
CLenEnc repLenProbs;
#ifndef LZMA_LOG_BSR
Byte g_FastPos[1 << kNumLogBits];
#endif
CLenPriceEnc lenEnc;
CLenPriceEnc repLenEnc;
COptimal opt[kNumOpts];
CSaveState saveState;
} CLzmaEnc;
#define COPY_ARR(dest, src, arr) memcpy(dest->arr, src->arr, sizeof(src->arr));
void LzmaEnc_SaveState(CLzmaEncHandle pp)
{
CLzmaEnc *p = (CLzmaEnc *)pp;
CSaveState *dest = &p->saveState;
dest->state = p->state;
dest->lenProbs = p->lenProbs;
dest->repLenProbs = p->repLenProbs;
COPY_ARR(dest, p, reps);
COPY_ARR(dest, p, posAlignEncoder);
COPY_ARR(dest, p, isRep);
COPY_ARR(dest, p, isRepG0);
COPY_ARR(dest, p, isRepG1);
COPY_ARR(dest, p, isRepG2);
COPY_ARR(dest, p, isMatch);
COPY_ARR(dest, p, isRep0Long);
COPY_ARR(dest, p, posSlotEncoder);
COPY_ARR(dest, p, posEncoders);
memcpy(dest->litProbs, p->litProbs, ((UInt32)0x300 << p->lclp) * sizeof(CLzmaProb));
}
void LzmaEnc_RestoreState(CLzmaEncHandle pp)
{
CLzmaEnc *dest = (CLzmaEnc *)pp;
const CSaveState *p = &dest->saveState;
dest->state = p->state;
dest->lenProbs = p->lenProbs;
dest->repLenProbs = p->repLenProbs;
COPY_ARR(dest, p, reps);
COPY_ARR(dest, p, posAlignEncoder);
COPY_ARR(dest, p, isRep);
COPY_ARR(dest, p, isRepG0);
COPY_ARR(dest, p, isRepG1);
COPY_ARR(dest, p, isRepG2);
COPY_ARR(dest, p, isMatch);
COPY_ARR(dest, p, isRep0Long);
COPY_ARR(dest, p, posSlotEncoder);
COPY_ARR(dest, p, posEncoders);
memcpy(dest->litProbs, p->litProbs, ((UInt32)0x300 << dest->lclp) * sizeof(CLzmaProb));
}
SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2)
{
CLzmaEnc *p = (CLzmaEnc *)pp;
CLzmaEncProps props = *props2;
LzmaEncProps_Normalize(&props);
if (props.lc > LZMA_LC_MAX
|| props.lp > LZMA_LP_MAX
|| props.pb > LZMA_PB_MAX
|| props.dictSize > ((UInt64)1 << kDicLogSizeMaxCompress)
|| props.dictSize > kLzmaMaxHistorySize)
return SZ_ERROR_PARAM;
p->dictSize = props.dictSize;
{
unsigned fb = props.fb;
if (fb < 5)
fb = 5;
if (fb > LZMA_MATCH_LEN_MAX)
fb = LZMA_MATCH_LEN_MAX;
p->numFastBytes = fb;
}
p->lc = props.lc;
p->lp = props.lp;
p->pb = props.pb;
p->fastMode = (props.algo == 0);
// p->_maxMode = True;
p->matchFinderBase.btMode = (Byte)(props.btMode ? 1 : 0);
{
unsigned numHashBytes = 4;
if (props.btMode)
{
if (props.numHashBytes < 2)
numHashBytes = 2;
else if (props.numHashBytes < 4)
numHashBytes = props.numHashBytes;
}
p->matchFinderBase.numHashBytes = numHashBytes;
}
p->matchFinderBase.cutValue = props.mc;
p->writeEndMark = props.writeEndMark;
return SZ_OK;
}
void LzmaEnc_SetDataSize(CLzmaEncHandle pp, UInt64 expectedDataSiize)
{
CLzmaEnc *p = (CLzmaEnc *)pp;
p->matchFinderBase.expectedDataSize = expectedDataSiize;
}
#define kState_Start 0
#define kState_LitAfterMatch 4
#define kState_LitAfterRep 5
#define kState_MatchAfterLit 7
#define kState_RepAfterLit 8
static const Byte kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5};
static const Byte kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
static const Byte kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
static const Byte kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
#define IsLitState(s) ((s) < 7)
#define GetLenToPosState2(len) (((len) < kNumLenToPosStates - 1) ? (len) : kNumLenToPosStates - 1)
#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1)
#define kInfinityPrice (1 << 30)
static void RangeEnc_Construct(CRangeEnc *p)
{
p->outStream = NULL;
p->bufBase = NULL;
}
#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize)
#define RangeEnc_GetProcessed_sizet(p) ((size_t)(p)->processed + ((p)->buf - (p)->bufBase) + (size_t)(p)->cacheSize)
#define RC_BUF_SIZE (1 << 16)
static int RangeEnc_Alloc(CRangeEnc *p, ISzAllocPtr alloc)
{
if (!p->bufBase)
{
p->bufBase = (Byte *)ISzAlloc_Alloc(alloc, RC_BUF_SIZE);
if (!p->bufBase)
return 0;
p->bufLim = p->bufBase + RC_BUF_SIZE;
}
return 1;
}
static void RangeEnc_Free(CRangeEnc *p, ISzAllocPtr alloc)
{
ISzAlloc_Free(alloc, p->bufBase);
p->bufBase = 0;
}
static void RangeEnc_Init(CRangeEnc *p)
{
/* Stream.Init(); */
p->range = 0xFFFFFFFF;
p->cache = 0;
p->low = 0;
p->cacheSize = 0;
p->buf = p->bufBase;
p->processed = 0;
p->res = SZ_OK;
}
MY_NO_INLINE static void RangeEnc_FlushStream(CRangeEnc *p)
{
size_t num;
if (p->res != SZ_OK)
return;
num = p->buf - p->bufBase;
if (num != ISeqOutStream_Write(p->outStream, p->bufBase, num))
p->res = SZ_ERROR_WRITE;
p->processed += num;
p->buf = p->bufBase;
}
MY_NO_INLINE static void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p)
{
UInt32 low = (UInt32)p->low;
unsigned high = (unsigned)(p->low >> 32);
p->low = (UInt32)(low << 8);
if (low < (UInt32)0xFF000000 || high != 0)
{
{
Byte *buf = p->buf;
*buf++ = (Byte)(p->cache + high);
p->cache = (unsigned)(low >> 24);
p->buf = buf;
if (buf == p->bufLim)
RangeEnc_FlushStream(p);
if (p->cacheSize == 0)
return;
}
high += 0xFF;
for (;;)
{
Byte *buf = p->buf;
*buf++ = (Byte)(high);
p->buf = buf;
if (buf == p->bufLim)
RangeEnc_FlushStream(p);
if (--p->cacheSize == 0)
return;
}
}
p->cacheSize++;
}
static void RangeEnc_FlushData(CRangeEnc *p)
{
int i;
for (i = 0; i < 5; i++)
RangeEnc_ShiftLow(p);
}
#define RC_NORM(p) if (range < kTopValue) { range <<= 8; RangeEnc_ShiftLow(p); }
#define RC_BIT_PRE(p, prob) \
ttt = *(prob); \
newBound = (range >> kNumBitModelTotalBits) * ttt;
// #define _LZMA_ENC_USE_BRANCH
#ifdef _LZMA_ENC_USE_BRANCH
#define RC_BIT(p, prob, bit) { \
RC_BIT_PRE(p, prob) \
if (bit == 0) { range = newBound; ttt += (kBitModelTotal - ttt) >> kNumMoveBits; } \
else { (p)->low += newBound; range -= newBound; ttt -= ttt >> kNumMoveBits; } \
*(prob) = (CLzmaProb)ttt; \
RC_NORM(p) \
}
#else
#define RC_BIT(p, prob, bit) { \
UInt32 mask; \
RC_BIT_PRE(p, prob) \
mask = 0 - (UInt32)bit; \
range &= mask; \
mask &= newBound; \
range -= mask; \
(p)->low += mask; \
mask = (UInt32)bit - 1; \
range += newBound & mask; \
mask &= (kBitModelTotal - ((1 << kNumMoveBits) - 1)); \
mask += ((1 << kNumMoveBits) - 1); \
ttt += (Int32)(mask - ttt) >> kNumMoveBits; \
*(prob) = (CLzmaProb)ttt; \
RC_NORM(p) \
}
#endif
#define RC_BIT_0_BASE(p, prob) \
range = newBound; *(prob) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
#define RC_BIT_1_BASE(p, prob) \
range -= newBound; (p)->low += newBound; *(prob) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits)); \
#define RC_BIT_0(p, prob) \
RC_BIT_0_BASE(p, prob) \
RC_NORM(p)
#define RC_BIT_1(p, prob) \
RC_BIT_1_BASE(p, prob) \
RC_NORM(p)
static void RangeEnc_EncodeBit_0(CRangeEnc *p, CLzmaProb *prob)
{
UInt32 range, ttt, newBound;
range = p->range;
RC_BIT_PRE(p, prob)
RC_BIT_0(p, prob)
p->range = range;
}
static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 sym)
{
UInt32 range = p->range;
sym |= 0x100;
do
{
UInt32 ttt, newBound;
// RangeEnc_EncodeBit(p, probs + (sym >> 8), (sym >> 7) & 1);
CLzmaProb *prob = probs + (sym >> 8);
UInt32 bit = (sym >> 7) & 1;
sym <<= 1;
RC_BIT(p, prob, bit);
}
while (sym < 0x10000);
p->range = range;
}
static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 sym, UInt32 matchByte)
{
UInt32 range = p->range;
UInt32 offs = 0x100;
sym |= 0x100;
do
{
UInt32 ttt, newBound;
CLzmaProb *prob;
UInt32 bit;
matchByte <<= 1;
// RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (sym >> 8)), (sym >> 7) & 1);
prob = probs + (offs + (matchByte & offs) + (sym >> 8));
bit = (sym >> 7) & 1;
sym <<= 1;
offs &= ~(matchByte ^ sym);
RC_BIT(p, prob, bit);
}
while (sym < 0x10000);
p->range = range;
}
static void LzmaEnc_InitPriceTables(CProbPrice *ProbPrices)
{
UInt32 i;
for (i = 0; i < (kBitModelTotal >> kNumMoveReducingBits); i++)
{
const unsigned kCyclesBits = kNumBitPriceShiftBits;
UInt32 w = (i << kNumMoveReducingBits) + (1 << (kNumMoveReducingBits - 1));
unsigned bitCount = 0;
unsigned j;
for (j = 0; j < kCyclesBits; j++)
{
w = w * w;
bitCount <<= 1;
while (w >= ((UInt32)1 << 16))
{
w >>= 1;
bitCount++;
}
}
ProbPrices[i] = (CProbPrice)((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount);
// printf("\n%3d: %5d", i, ProbPrices[i]);
}
}
#define GET_PRICE(prob, bit) \
p->ProbPrices[((prob) ^ (unsigned)(((-(int)(bit))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
#define GET_PRICEa(prob, bit) \
ProbPrices[((prob) ^ (unsigned)((-((int)(bit))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits]
#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]
#define GET_PRICEa_0(prob) ProbPrices[(prob) >> kNumMoveReducingBits]
#define GET_PRICEa_1(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]
static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 sym, const CProbPrice *ProbPrices)
{
UInt32 price = 0;
sym |= 0x100;
do
{
unsigned bit = sym & 1;
sym >>= 1;
price += GET_PRICEa(probs[sym], bit);
}
while (sym >= 2);
return price;
}
static UInt32 LitEnc_Matched_GetPrice(const CLzmaProb *probs, UInt32 sym, UInt32 matchByte, const CProbPrice *ProbPrices)
{
UInt32 price = 0;
UInt32 offs = 0x100;
sym |= 0x100;
do
{
matchByte <<= 1;
price += GET_PRICEa(probs[offs + (matchByte & offs) + (sym >> 8)], (sym >> 7) & 1);
sym <<= 1;
offs &= ~(matchByte ^ sym);
}
while (sym < 0x10000);
return price;
}
static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, unsigned numBits, unsigned sym)
{
UInt32 range = rc->range;
unsigned m = 1;
do
{
UInt32 ttt, newBound;
unsigned bit = sym & 1;
// RangeEnc_EncodeBit(rc, probs + m, bit);
sym >>= 1;
RC_BIT(rc, probs + m, bit);
m = (m << 1) | bit;
}
while (--numBits);
rc->range = range;
}
static void LenEnc_Init(CLenEnc *p)
{
unsigned i;
for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << (kLenNumLowBits + 1)); i++)
p->low[i] = kProbInitValue;
for (i = 0; i < kLenNumHighSymbols; i++)
p->high[i] = kProbInitValue;
}
static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, unsigned sym, unsigned posState)
{
UInt32 range, ttt, newBound;
CLzmaProb *probs = p->low;
range = rc->range;
RC_BIT_PRE(rc, probs);
if (sym >= kLenNumLowSymbols)
{
RC_BIT_1(rc, probs);
probs += kLenNumLowSymbols;
RC_BIT_PRE(rc, probs);
if (sym >= kLenNumLowSymbols * 2)
{
RC_BIT_1(rc, probs);
rc->range = range;
// RcTree_Encode(rc, p->high, kLenNumHighBits, sym - kLenNumLowSymbols * 2);
LitEnc_Encode(rc, p->high, sym - kLenNumLowSymbols * 2);
return;
}
sym -= kLenNumLowSymbols;
}
// RcTree_Encode(rc, probs + (posState << kLenNumLowBits), kLenNumLowBits, sym);
{
unsigned m;
unsigned bit;
RC_BIT_0(rc, probs);
probs += (posState << (1 + kLenNumLowBits));
bit = (sym >> 2) ; RC_BIT(rc, probs + 1, bit); m = (1 << 1) + bit;
bit = (sym >> 1) & 1; RC_BIT(rc, probs + m, bit); m = (m << 1) + bit;
bit = sym & 1; RC_BIT(rc, probs + m, bit);
rc->range = range;
}
}
static void SetPrices_3(const CLzmaProb *probs, UInt32 startPrice, UInt32 *prices, const CProbPrice *ProbPrices)
{
unsigned i;
for (i = 0; i < 8; i += 2)
{
UInt32 price = startPrice;
UInt32 prob;
price += GET_PRICEa(probs[1 ], (i >> 2));
price += GET_PRICEa(probs[2 + (i >> 2)], (i >> 1) & 1);
prob = probs[4 + (i >> 1)];
prices[i ] = price + GET_PRICEa_0(prob);
prices[i + 1] = price + GET_PRICEa_1(prob);
}
}
MY_NO_INLINE static void MY_FAST_CALL LenPriceEnc_UpdateTables(
CLenPriceEnc *p,
unsigned numPosStates,
const CLenEnc *enc,
const CProbPrice *ProbPrices)
{
UInt32 b;
{
unsigned prob = enc->low[0];
UInt32 a, c;
unsigned posState;
b = GET_PRICEa_1(prob);
a = GET_PRICEa_0(prob);
c = b + GET_PRICEa_0(enc->low[kLenNumLowSymbols]);
for (posState = 0; posState < numPosStates; posState++)
{
UInt32 *prices = p->prices[posState];
const CLzmaProb *probs = enc->low + (posState << (1 + kLenNumLowBits));
SetPrices_3(probs, a, prices, ProbPrices);
SetPrices_3(probs + kLenNumLowSymbols, c, prices + kLenNumLowSymbols, ProbPrices);
}
}
/*
{
unsigned i;
UInt32 b;
a = GET_PRICEa_0(enc->low[0]);
for (i = 0; i < kLenNumLowSymbols; i++)
p->prices2[i] = a;
a = GET_PRICEa_1(enc->low[0]);
b = a + GET_PRICEa_0(enc->low[kLenNumLowSymbols]);
for (i = kLenNumLowSymbols; i < kLenNumLowSymbols * 2; i++)
p->prices2[i] = b;
a += GET_PRICEa_1(enc->low[kLenNumLowSymbols]);
}
*/
// p->counter = numSymbols;
// p->counter = 64;
{
unsigned i = p->tableSize;
if (i > kLenNumLowSymbols * 2)
{
const CLzmaProb *probs = enc->high;
UInt32 *prices = p->prices[0] + kLenNumLowSymbols * 2;
i -= kLenNumLowSymbols * 2 - 1;
i >>= 1;
b += GET_PRICEa_1(enc->low[kLenNumLowSymbols]);
do
{
/*
p->prices2[i] = a +
// RcTree_GetPrice(enc->high, kLenNumHighBits, i - kLenNumLowSymbols * 2, ProbPrices);
LitEnc_GetPrice(probs, i - kLenNumLowSymbols * 2, ProbPrices);
*/
// UInt32 price = a + RcTree_GetPrice(probs, kLenNumHighBits - 1, sym, ProbPrices);
unsigned sym = --i + (1 << (kLenNumHighBits - 1));
UInt32 price = b;
do
{
unsigned bit = sym & 1;
sym >>= 1;
price += GET_PRICEa(probs[sym], bit);
}
while (sym >= 2);
{
unsigned prob = probs[(size_t)i + (1 << (kLenNumHighBits - 1))];
prices[(size_t)i * 2 ] = price + GET_PRICEa_0(prob);
prices[(size_t)i * 2 + 1] = price + GET_PRICEa_1(prob);
}
}
while (i);
{
unsigned posState;
size_t num = (p->tableSize - kLenNumLowSymbols * 2) * sizeof(p->prices[0][0]);
for (posState = 1; posState < numPosStates; posState++)
memcpy(p->prices[posState] + kLenNumLowSymbols * 2, p->prices[0] + kLenNumLowSymbols * 2, num);
}
}
}
}
/*
#ifdef SHOW_STAT
g_STAT_OFFSET += num;
printf("\n MovePos %u", num);
#endif
*/
#define MOVE_POS(p, num) { \
p->additionalOffset += (num); \
p->matchFinder.Skip(p->matchFinderObj, (UInt32)(num)); }
static unsigned ReadMatchDistances(CLzmaEnc *p, unsigned *numPairsRes)
{
unsigned numPairs;
p->additionalOffset++;
p->numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);
numPairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matches);
*numPairsRes = numPairs;
#ifdef SHOW_STAT
printf("\n i = %u numPairs = %u ", g_STAT_OFFSET, numPairs / 2);
g_STAT_OFFSET++;
{
unsigned i;
for (i = 0; i < numPairs; i += 2)
printf("%2u %6u | ", p->matches[i], p->matches[i + 1]);
}
#endif
if (numPairs == 0)
return 0;
{
unsigned len = p->matches[(size_t)numPairs - 2];
if (len != p->numFastBytes)
return len;
{
UInt32 numAvail = p->numAvail;
if (numAvail > LZMA_MATCH_LEN_MAX)
numAvail = LZMA_MATCH_LEN_MAX;
{
const Byte *p1 = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
const Byte *p2 = p1 + len;
ptrdiff_t dif = (ptrdiff_t)-1 - p->matches[(size_t)numPairs - 1];
const Byte *lim = p1 + numAvail;
for (; p2 != lim && *p2 == p2[dif]; p2++)
{}
return (unsigned)(p2 - p1);
}
}
}
}
#define MARK_LIT ((UInt32)(Int32)-1)
#define MakeAs_Lit(p) { (p)->dist = MARK_LIT; (p)->extra = 0; }
#define MakeAs_ShortRep(p) { (p)->dist = 0; (p)->extra = 0; }
#define IsShortRep(p) ((p)->dist == 0)
#define GetPrice_ShortRep(p, state, posState) \
( GET_PRICE_0(p->isRepG0[state]) + GET_PRICE_0(p->isRep0Long[state][posState]))
#define GetPrice_Rep_0(p, state, posState) ( \
GET_PRICE_1(p->isMatch[state][posState]) \
+ GET_PRICE_1(p->isRep0Long[state][posState])) \
+ GET_PRICE_1(p->isRep[state]) \
+ GET_PRICE_0(p->isRepG0[state])
MY_FORCE_INLINE
static UInt32 GetPrice_PureRep(const CLzmaEnc *p, unsigned repIndex, size_t state, size_t posState)
{
UInt32 price;
UInt32 prob = p->isRepG0[state];
if (repIndex == 0)
{
price = GET_PRICE_0(prob);
price += GET_PRICE_1(p->isRep0Long[state][posState]);
}
else
{
price = GET_PRICE_1(prob);
prob = p->isRepG1[state];
if (repIndex == 1)
price += GET_PRICE_0(prob);
else
{
price += GET_PRICE_1(prob);
price += GET_PRICE(p->isRepG2[state], repIndex - 2);
}
}
return price;
}
static unsigned Backward(CLzmaEnc *p, unsigned cur)
{
unsigned wr = cur + 1;
p->optEnd = wr;
for (;;)
{
UInt32 dist = p->opt[cur].dist;
unsigned len = (unsigned)p->opt[cur].len;
unsigned extra = (unsigned)p->opt[cur].extra;
cur -= len;
if (extra)
{
wr--;
p->opt[wr].len = (UInt32)len;
cur -= extra;
len = extra;
if (extra == 1)
{
p->opt[wr].dist = dist;
dist = MARK_LIT;
}
else
{
p->opt[wr].dist = 0;
len--;
wr--;
p->opt[wr].dist = MARK_LIT;
p->opt[wr].len = 1;
}
}
if (cur == 0)
{
p->backRes = dist;
p->optCur = wr;
return len;
}
wr--;
p->opt[wr].dist = dist;
p->opt[wr].len = (UInt32)len;
}
}
#define LIT_PROBS(pos, prevByte) \
(p->litProbs + (UInt32)3 * (((((pos) << 8) + (prevByte)) & p->lpMask) << p->lc))
static unsigned GetOptimum(CLzmaEnc *p, UInt32 position)
{
unsigned last, cur;
UInt32 reps[LZMA_NUM_REPS];
unsigned repLens[LZMA_NUM_REPS];
UInt32 *matches;
{
UInt32 numAvail;
unsigned numPairs, mainLen, repMaxIndex, i, posState;
UInt32 matchPrice, repMatchPrice;
const Byte *data;
Byte curByte, matchByte;
p->optCur = p->optEnd = 0;
if (p->additionalOffset == 0)
mainLen = ReadMatchDistances(p, &numPairs);
else
{
mainLen = p->longestMatchLen;
numPairs = p->numPairs;
}
numAvail = p->numAvail;
if (numAvail < 2)
{
p->backRes = MARK_LIT;
return 1;
}
if (numAvail > LZMA_MATCH_LEN_MAX)
numAvail = LZMA_MATCH_LEN_MAX;
data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
repMaxIndex = 0;
for (i = 0; i < LZMA_NUM_REPS; i++)
{
unsigned len;
const Byte *data2;
reps[i] = p->reps[i];
data2 = data - reps[i];
if (data[0] != data2[0] || data[1] != data2[1])
{
repLens[i] = 0;
continue;
}
for (len = 2; len < numAvail && data[len] == data2[len]; len++)
{}
repLens[i] = len;
if (len > repLens[repMaxIndex])
repMaxIndex = i;
}
if (repLens[repMaxIndex] >= p->numFastBytes)
{
unsigned len;
p->backRes = (UInt32)repMaxIndex;
len = repLens[repMaxIndex];
MOVE_POS(p, len - 1)
return len;
}
matches = p->matches;
if (mainLen >= p->numFastBytes)
{
p->backRes = matches[(size_t)numPairs - 1] + LZMA_NUM_REPS;
MOVE_POS(p, mainLen - 1)
return mainLen;
}
curByte = *data;
matchByte = *(data - reps[0]);
last = repLens[repMaxIndex];
if (last <= mainLen)
last = mainLen;
if (last < 2 && curByte != matchByte)
{
p->backRes = MARK_LIT;
return 1;
}
p->opt[0].state = (CState)p->state;
posState = (position & p->pbMask);
{
const CLzmaProb *probs = LIT_PROBS(position, *(data - 1));
p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) +
(!IsLitState(p->state) ?
LitEnc_Matched_GetPrice(probs, curByte, matchByte, p->ProbPrices) :
LitEnc_GetPrice(probs, curByte, p->ProbPrices));
}
MakeAs_Lit(&p->opt[1]);
matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]);
repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]);
// 18.06
if (matchByte == curByte && repLens[0] == 0)
{
UInt32 shortRepPrice = repMatchPrice + GetPrice_ShortRep(p, p->state, posState);
if (shortRepPrice < p->opt[1].price)
{
p->opt[1].price = shortRepPrice;
MakeAs_ShortRep(&p->opt[1]);
}
if (last < 2)
{
p->backRes = p->opt[1].dist;
return 1;
}
}
p->opt[1].len = 1;
p->opt[0].reps[0] = reps[0];
p->opt[0].reps[1] = reps[1];
p->opt[0].reps[2] = reps[2];
p->opt[0].reps[3] = reps[3];
// ---------- REP ----------
for (i = 0; i < LZMA_NUM_REPS; i++)
{
unsigned repLen = repLens[i];
UInt32 price;
if (repLen < 2)
continue;
price = repMatchPrice + GetPrice_PureRep(p, i, p->state, posState);
do
{
UInt32 price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState, repLen);
COptimal *opt = &p->opt[repLen];
if (price2 < opt->price)
{
opt->price = price2;
opt->len = (UInt32)repLen;
opt->dist = (UInt32)i;
opt->extra = 0;
}
}
while (--repLen >= 2);
}
// ---------- MATCH ----------
{
unsigned len = repLens[0] + 1;
if (len <= mainLen)
{
unsigned offs = 0;
UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]);
if (len < 2)
len = 2;
else
while (len > matches[offs])
offs += 2;
for (; ; len++)
{
COptimal *opt;
UInt32 dist = matches[(size_t)offs + 1];
UInt32 price = normalMatchPrice + GET_PRICE_LEN(&p->lenEnc, posState, len);
unsigned lenToPosState = GetLenToPosState(len);
if (dist < kNumFullDistances)
price += p->distancesPrices[lenToPosState][dist & (kNumFullDistances - 1)];
else
{
unsigned slot;
GetPosSlot2(dist, slot);
price += p->alignPrices[dist & kAlignMask];
price += p->posSlotPrices[lenToPosState][slot];
}
opt = &p->opt[len];
if (price < opt->price)
{
opt->price = price;
opt->len = (UInt32)len;
opt->dist = dist + LZMA_NUM_REPS;
opt->extra = 0;
}
if (len == matches[offs])
{
offs += 2;
if (offs == numPairs)
break;
}
}
}
}
cur = 0;
#ifdef SHOW_STAT2
/* if (position >= 0) */
{
unsigned i;
printf("\n pos = %4X", position);
for (i = cur; i <= last; i++)
printf("\nprice[%4X] = %u", position - cur + i, p->opt[i].price);
}
#endif
}
// ---------- Optimal Parsing ----------
for (;;)
{
unsigned numAvail;
UInt32 numAvailFull;
unsigned newLen, numPairs, prev, state, posState, startLen;
UInt32 litPrice, matchPrice, repMatchPrice;
BoolInt nextIsLit;
Byte curByte, matchByte;
const Byte *data;
COptimal *curOpt, *nextOpt;
if (++cur == last)
break;
// 18.06
if (cur >= kNumOpts - 64)
{
unsigned j, best;
UInt32 price = p->opt[cur].price;
best = cur;
for (j = cur + 1; j <= last; j++)
{
UInt32 price2 = p->opt[j].price;
if (price >= price2)
{
price = price2;
best = j;
}
}
{
unsigned delta = best - cur;
if (delta != 0)
{
MOVE_POS(p, delta);
}
}
cur = best;
break;
}
newLen = ReadMatchDistances(p, &numPairs);
if (newLen >= p->numFastBytes)
{
p->numPairs = numPairs;
p->longestMatchLen = newLen;
break;
}
curOpt = &p->opt[cur];
position++;
// we need that check here, if skip_items in p->opt are possible
/*
if (curOpt->price >= kInfinityPrice)
continue;
*/
prev = cur - curOpt->len;
if (curOpt->len == 1)
{
state = (unsigned)p->opt[prev].state;
if (IsShortRep(curOpt))
state = kShortRepNextStates[state];
else
state = kLiteralNextStates[state];
}
else
{
const COptimal *prevOpt;
UInt32 b0;
UInt32 dist = curOpt->dist;
if (curOpt->extra)
{
prev -= (unsigned)curOpt->extra;
state = kState_RepAfterLit;
if (curOpt->extra == 1)
state = (dist < LZMA_NUM_REPS ? kState_RepAfterLit : kState_MatchAfterLit);
}
else
{
state = (unsigned)p->opt[prev].state;
if (dist < LZMA_NUM_REPS)
state = kRepNextStates[state];
else
state = kMatchNextStates[state];
}
prevOpt = &p->opt[prev];
b0 = prevOpt->reps[0];
if (dist < LZMA_NUM_REPS)
{
if (dist == 0)
{
reps[0] = b0;
reps[1] = prevOpt->reps[1];
reps[2] = prevOpt->reps[2];
reps[3] = prevOpt->reps[3];
}
else
{
reps[1] = b0;
b0 = prevOpt->reps[1];
if (dist == 1)
{
reps[0] = b0;
reps[2] = prevOpt->reps[2];
reps[3] = prevOpt->reps[3];
}
else
{
reps[2] = b0;
reps[0] = prevOpt->reps[dist];
reps[3] = prevOpt->reps[dist ^ 1];
}
}
}
else
{
reps[0] = (dist - LZMA_NUM_REPS + 1);
reps[1] = b0;
reps[2] = prevOpt->reps[1];
reps[3] = prevOpt->reps[2];
}
}
curOpt->state = (CState)state;
curOpt->reps[0] = reps[0];
curOpt->reps[1] = reps[1];
curOpt->reps[2] = reps[2];
curOpt->reps[3] = reps[3];
data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
curByte = *data;
matchByte = *(data - reps[0]);
posState = (position & p->pbMask);
/*
The order of Price checks:
< LIT
<= SHORT_REP
< LIT : REP_0
< REP [ : LIT : REP_0 ]
< MATCH [ : LIT : REP_0 ]
*/
{
UInt32 curPrice = curOpt->price;
unsigned prob = p->isMatch[state][posState];
matchPrice = curPrice + GET_PRICE_1(prob);
litPrice = curPrice + GET_PRICE_0(prob);
}
nextOpt = &p->opt[(size_t)cur + 1];
nextIsLit = False;
// here we can allow skip_items in p->opt, if we don't check (nextOpt->price < kInfinityPrice)
// 18.new.06
if ((nextOpt->price < kInfinityPrice
// && !IsLitState(state)
&& matchByte == curByte)
|| litPrice > nextOpt->price
)
litPrice = 0;
else
{
const CLzmaProb *probs = LIT_PROBS(position, *(data - 1));
litPrice += (!IsLitState(state) ?
LitEnc_Matched_GetPrice(probs, curByte, matchByte, p->ProbPrices) :
LitEnc_GetPrice(probs, curByte, p->ProbPrices));
if (litPrice < nextOpt->price)
{
nextOpt->price = litPrice;
nextOpt->len = 1;
MakeAs_Lit(nextOpt);
nextIsLit = True;
}
}
repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]);
numAvailFull = p->numAvail;
{
unsigned temp = kNumOpts - 1 - cur;
if (numAvailFull > temp)
numAvailFull = (UInt32)temp;
}
// 18.06
// ---------- SHORT_REP ----------
if (IsLitState(state)) // 18.new
if (matchByte == curByte)
if (repMatchPrice < nextOpt->price) // 18.new
// if (numAvailFull < 2 || data[1] != *(data - reps[0] + 1))
if (
// nextOpt->price >= kInfinityPrice ||
nextOpt->len < 2 // we can check nextOpt->len, if skip items are not allowed in p->opt
|| (nextOpt->dist != 0
// && nextOpt->extra <= 1 // 17.old
)
)
{
UInt32 shortRepPrice = repMatchPrice + GetPrice_ShortRep(p, state, posState);
// if (shortRepPrice <= nextOpt->price) // 17.old
if (shortRepPrice < nextOpt->price) // 18.new
{
nextOpt->price = shortRepPrice;
nextOpt->len = 1;
MakeAs_ShortRep(nextOpt);
nextIsLit = False;
}
}
if (numAvailFull < 2)
continue;
numAvail = (numAvailFull <= p->numFastBytes ? numAvailFull : p->numFastBytes);
// numAvail <= p->numFastBytes
// ---------- LIT : REP_0 ----------
if (!nextIsLit
&& litPrice != 0 // 18.new
&& matchByte != curByte
&& numAvailFull > 2)
{
const Byte *data2 = data - reps[0];
if (data[1] == data2[1] && data[2] == data2[2])
{
unsigned len;
unsigned limit = p->numFastBytes + 1;
if (limit > numAvailFull)
limit = numAvailFull;
for (len = 3; len < limit && data[len] == data2[len]; len++)
{}
{
unsigned state2 = kLiteralNextStates[state];
unsigned posState2 = (position + 1) & p->pbMask;
UInt32 price = litPrice + GetPrice_Rep_0(p, state2, posState2);
{
unsigned offset = cur + len;
if (last < offset)
last = offset;
// do
{
UInt32 price2;
COptimal *opt;
len--;
// price2 = price + GetPrice_Len_Rep_0(p, len, state2, posState2);
price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState2, len);
opt = &p->opt[offset];
// offset--;
if (price2 < opt->price)
{
opt->price = price2;
opt->len = (UInt32)len;
opt->dist = 0;
opt->extra = 1;
}
}
// while (len >= 3);
}
}
}
}
startLen = 2; /* speed optimization */
{
// ---------- REP ----------
unsigned repIndex = 0; // 17.old
// unsigned repIndex = IsLitState(state) ? 0 : 1; // 18.notused
for (; repIndex < LZMA_NUM_REPS; repIndex++)
{
unsigned len;
UInt32 price;
const Byte *data2 = data - reps[repIndex];
if (data[0] != data2[0] || data[1] != data2[1])
continue;
for (len = 2; len < numAvail && data[len] == data2[len]; len++)
{}
// if (len < startLen) continue; // 18.new: speed optimization
{
unsigned offset = cur + len;
if (last < offset)
last = offset;
}
{
unsigned len2 = len;
price = repMatchPrice + GetPrice_PureRep(p, repIndex, state, posState);
do
{
UInt32 price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState, len2);
COptimal *opt = &p->opt[cur + len2];
if (price2 < opt->price)
{
opt->price = price2;
opt->len = (UInt32)len2;
opt->dist = (UInt32)repIndex;
opt->extra = 0;
}
}
while (--len2 >= 2);
}
if (repIndex == 0) startLen = len + 1; // 17.old
// startLen = len + 1; // 18.new
/* if (_maxMode) */
{
// ---------- REP : LIT : REP_0 ----------
// numFastBytes + 1 + numFastBytes
unsigned len2 = len + 1;
unsigned limit = len2 + p->numFastBytes;
if (limit > numAvailFull)
limit = numAvailFull;
len2 += 2;
if (len2 <= limit)
if (data[len2 - 2] == data2[len2 - 2])
if (data[len2 - 1] == data2[len2 - 1])
{
unsigned state2 = kRepNextStates[state];
unsigned posState2 = (position + len) & p->pbMask;
price += GET_PRICE_LEN(&p->repLenEnc, posState, len)
+ GET_PRICE_0(p->isMatch[state2][posState2])
+ LitEnc_Matched_GetPrice(LIT_PROBS(position + len, data[(size_t)len - 1]),
data[len], data2[len], p->ProbPrices);
// state2 = kLiteralNextStates[state2];
state2 = kState_LitAfterRep;
posState2 = (posState2 + 1) & p->pbMask;
price += GetPrice_Rep_0(p, state2, posState2);
for (; len2 < limit && data[len2] == data2[len2]; len2++)
{}
len2 -= len;
// if (len2 >= 3)
{
{
unsigned offset = cur + len + len2;
if (last < offset)
last = offset;
// do
{
UInt32 price2;
COptimal *opt;
len2--;
// price2 = price + GetPrice_Len_Rep_0(p, len2, state2, posState2);
price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState2, len2);
opt = &p->opt[offset];
// offset--;
if (price2 < opt->price)
{
opt->price = price2;
opt->len = (UInt32)len2;
opt->extra = (CExtra)(len + 1);
opt->dist = (UInt32)repIndex;
}
}
// while (len2 >= 3);
}
}
}
}
}
}
// ---------- MATCH ----------
/* for (unsigned len = 2; len <= newLen; len++) */
if (newLen > numAvail)
{
newLen = numAvail;
for (numPairs = 0; newLen > matches[numPairs]; numPairs += 2);
matches[numPairs] = (UInt32)newLen;
numPairs += 2;
}
// startLen = 2; /* speed optimization */
if (newLen >= startLen)
{
UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]);
UInt32 dist;
unsigned offs, posSlot, len;
{
unsigned offset = cur + newLen;
if (last < offset)
last = offset;
}
offs = 0;
while (startLen > matches[offs])
offs += 2;
dist = matches[(size_t)offs + 1];
// if (dist >= kNumFullDistances)
GetPosSlot2(dist, posSlot);
for (len = /*2*/ startLen; ; len++)
{
UInt32 price = normalMatchPrice + GET_PRICE_LEN(&p->lenEnc, posState, len);
{
COptimal *opt;
unsigned lenNorm = len - 2;
lenNorm = GetLenToPosState2(lenNorm);
if (dist < kNumFullDistances)
price += p->distancesPrices[lenNorm][dist & (kNumFullDistances - 1)];
else
price += p->posSlotPrices[lenNorm][posSlot] + p->alignPrices[dist & kAlignMask];
opt = &p->opt[cur + len];
if (price < opt->price)
{
opt->price = price;
opt->len = (UInt32)len;
opt->dist = dist + LZMA_NUM_REPS;
opt->extra = 0;
}
}
if (len == matches[offs])
{
// if (p->_maxMode) {
// MATCH : LIT : REP_0
const Byte *data2 = data - dist - 1;
unsigned len2 = len + 1;
unsigned limit = len2 + p->numFastBytes;
if (limit > numAvailFull)
limit = numAvailFull;
len2 += 2;
if (len2 <= limit)
if (data[len2 - 2] == data2[len2 - 2])
if (data[len2 - 1] == data2[len2 - 1])
{
for (; len2 < limit && data[len2] == data2[len2]; len2++)
{}
len2 -= len;
// if (len2 >= 3)
{
unsigned state2 = kMatchNextStates[state];
unsigned posState2 = (position + len) & p->pbMask;
unsigned offset;
price += GET_PRICE_0(p->isMatch[state2][posState2]);
price += LitEnc_Matched_GetPrice(LIT_PROBS(position + len, data[(size_t)len - 1]),
data[len], data2[len], p->ProbPrices);
// state2 = kLiteralNextStates[state2];
state2 = kState_LitAfterMatch;
posState2 = (posState2 + 1) & p->pbMask;
price += GetPrice_Rep_0(p, state2, posState2);
offset = cur + len + len2;
if (last < offset)
last = offset;
// do
{
UInt32 price2;
COptimal *opt;
len2--;
// price2 = price + GetPrice_Len_Rep_0(p, len2, state2, posState2);
price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState2, len2);
opt = &p->opt[offset];
// offset--;
if (price2 < opt->price)
{
opt->price = price2;
opt->len = (UInt32)len2;
opt->extra = (CExtra)(len + 1);
opt->dist = dist + LZMA_NUM_REPS;
}
}
// while (len2 >= 3);
}
}
offs += 2;
if (offs == numPairs)
break;
dist = matches[(size_t)offs + 1];
// if (dist >= kNumFullDistances)
GetPosSlot2(dist, posSlot);
}
}
}
}
do
p->opt[last].price = kInfinityPrice;
while (--last);
return Backward(p, cur);
}
#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist))
static unsigned GetOptimumFast(CLzmaEnc *p)
{
UInt32 numAvail, mainDist;
unsigned mainLen, numPairs, repIndex, repLen, i;
const Byte *data;
if (p->additionalOffset == 0)
mainLen = ReadMatchDistances(p, &numPairs);
else
{
mainLen = p->longestMatchLen;
numPairs = p->numPairs;
}
numAvail = p->numAvail;
p->backRes = MARK_LIT;
if (numAvail < 2)
return 1;
// if (mainLen < 2 && p->state == 0) return 1; // 18.06.notused
if (numAvail > LZMA_MATCH_LEN_MAX)
numAvail = LZMA_MATCH_LEN_MAX;
data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
repLen = repIndex = 0;
for (i = 0; i < LZMA_NUM_REPS; i++)
{
unsigned len;
const Byte *data2 = data - p->reps[i];
if (data[0] != data2[0] || data[1] != data2[1])
continue;
for (len = 2; len < numAvail && data[len] == data2[len]; len++)
{}
if (len >= p->numFastBytes)
{
p->backRes = (UInt32)i;
MOVE_POS(p, len - 1)
return len;
}
if (len > repLen)
{
repIndex = i;
repLen = len;
}
}
if (mainLen >= p->numFastBytes)
{
p->backRes = p->matches[(size_t)numPairs - 1] + LZMA_NUM_REPS;
MOVE_POS(p, mainLen - 1)
return mainLen;
}
mainDist = 0; /* for GCC */
if (mainLen >= 2)
{
mainDist = p->matches[(size_t)numPairs - 1];
while (numPairs > 2)
{
UInt32 dist2;
if (mainLen != p->matches[(size_t)numPairs - 4] + 1)
break;
dist2 = p->matches[(size_t)numPairs - 3];
if (!ChangePair(dist2, mainDist))
break;
numPairs -= 2;
mainLen--;
mainDist = dist2;
}
if (mainLen == 2 && mainDist >= 0x80)
mainLen = 1;
}
if (repLen >= 2)
if ( repLen + 1 >= mainLen
|| (repLen + 2 >= mainLen && mainDist >= (1 << 9))
|| (repLen + 3 >= mainLen && mainDist >= (1 << 15)))
{
p->backRes = (UInt32)repIndex;
MOVE_POS(p, repLen - 1)
return repLen;
}
if (mainLen < 2 || numAvail <= 2)
return 1;
{
unsigned len1 = ReadMatchDistances(p, &p->numPairs);
p->longestMatchLen = len1;
if (len1 >= 2)
{
UInt32 newDist = p->matches[(size_t)p->numPairs - 1];
if ( (len1 >= mainLen && newDist < mainDist)
|| (len1 == mainLen + 1 && !ChangePair(mainDist, newDist))
|| (len1 > mainLen + 1)
|| (len1 + 1 >= mainLen && mainLen >= 3 && ChangePair(newDist, mainDist)))
return 1;
}
}
data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
for (i = 0; i < LZMA_NUM_REPS; i++)
{
unsigned len, limit;
const Byte *data2 = data - p->reps[i];
if (data[0] != data2[0] || data[1] != data2[1])
continue;
limit = mainLen - 1;
for (len = 2;; len++)
{
if (len >= limit)
return 1;
if (data[len] != data2[len])
break;
}
}
p->backRes = mainDist + LZMA_NUM_REPS;
if (mainLen != 2)
{
MOVE_POS(p, mainLen - 2)
}
return mainLen;
}
static void WriteEndMarker(CLzmaEnc *p, unsigned posState)
{
UInt32 range;
range = p->rc.range;
{
UInt32 ttt, newBound;
CLzmaProb *prob = &p->isMatch[p->state][posState];
RC_BIT_PRE(&p->rc, prob)
RC_BIT_1(&p->rc, prob)
prob = &p->isRep[p->state];
RC_BIT_PRE(&p->rc, prob)
RC_BIT_0(&p->rc, prob)
}
p->state = kMatchNextStates[p->state];
p->rc.range = range;
LenEnc_Encode(&p->lenProbs, &p->rc, 0, posState);
range = p->rc.range;
{
// RcTree_Encode_PosSlot(&p->rc, p->posSlotEncoder[0], (1 << kNumPosSlotBits) - 1);
CLzmaProb *probs = p->posSlotEncoder[0];
unsigned m = 1;
do
{
UInt32 ttt, newBound;
RC_BIT_PRE(p, probs + m)
RC_BIT_1(&p->rc, probs + m);
m = (m << 1) + 1;
}
while (m < (1 << kNumPosSlotBits));
}
{
// RangeEnc_EncodeDirectBits(&p->rc, ((UInt32)1 << (30 - kNumAlignBits)) - 1, 30 - kNumAlignBits); UInt32 range = p->range;
unsigned numBits = 30 - kNumAlignBits;
do
{
range >>= 1;
p->rc.low += range;
RC_NORM(&p->rc)
}
while (--numBits);
}
{
// RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask);
CLzmaProb *probs = p->posAlignEncoder;
unsigned m = 1;
do
{
UInt32 ttt, newBound;
RC_BIT_PRE(p, probs + m)
RC_BIT_1(&p->rc, probs + m);
m = (m << 1) + 1;
}
while (m < kAlignTableSize);
}
p->rc.range = range;
}
static SRes CheckErrors(CLzmaEnc *p)
{
if (p->result != SZ_OK)
return p->result;
if (p->rc.res != SZ_OK)
p->result = SZ_ERROR_WRITE;
if (p->matchFinderBase.result != SZ_OK)
p->result = SZ_ERROR_READ;
if (p->result != SZ_OK)
p->finished = True;
return p->result;
}
MY_NO_INLINE static SRes Flush(CLzmaEnc *p, UInt32 nowPos)
{
/* ReleaseMFStream(); */
p->finished = True;
if (p->writeEndMark)
WriteEndMarker(p, nowPos & p->pbMask);
RangeEnc_FlushData(&p->rc);
RangeEnc_FlushStream(&p->rc);
return CheckErrors(p);
}
MY_NO_INLINE static void FillAlignPrices(CLzmaEnc *p)
{
unsigned i;
const CProbPrice *ProbPrices = p->ProbPrices;
const CLzmaProb *probs = p->posAlignEncoder;
// p->alignPriceCount = 0;
for (i = 0; i < kAlignTableSize / 2; i++)
{
UInt32 price = 0;
unsigned sym = i;
unsigned m = 1;
unsigned bit;
UInt32 prob;
bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit;
bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit;
bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit;
prob = probs[m];
p->alignPrices[i ] = price + GET_PRICEa_0(prob);
p->alignPrices[i + 8] = price + GET_PRICEa_1(prob);
// p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices);
}
}
MY_NO_INLINE static void FillDistancesPrices(CLzmaEnc *p)
{
// int y; for (y = 0; y < 100; y++) {
UInt32 tempPrices[kNumFullDistances];
unsigned i, lps;
const CProbPrice *ProbPrices = p->ProbPrices;
p->matchPriceCount = 0;
for (i = kStartPosModelIndex / 2; i < kNumFullDistances / 2; i++)
{
unsigned posSlot = GetPosSlot1(i);
unsigned footerBits = (posSlot >> 1) - 1;
unsigned base = ((2 | (posSlot & 1)) << footerBits);
const CLzmaProb *probs = p->posEncoders + (size_t)base * 2;
// tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base, footerBits, i - base, p->ProbPrices);
UInt32 price = 0;
unsigned m = 1;
unsigned sym = i;
unsigned offset = (unsigned)1 << footerBits;
base += i;
if (footerBits)
do
{
unsigned bit = sym & 1;
sym >>= 1;
price += GET_PRICEa(probs[m], bit);
m = (m << 1) + bit;
}
while (--footerBits);
{
unsigned prob = probs[m];
tempPrices[base ] = price + GET_PRICEa_0(prob);
tempPrices[base + offset] = price + GET_PRICEa_1(prob);
}
}
for (lps = 0; lps < kNumLenToPosStates; lps++)
{
unsigned slot;
unsigned distTableSize2 = (p->distTableSize + 1) >> 1;
UInt32 *posSlotPrices = p->posSlotPrices[lps];
const CLzmaProb *probs = p->posSlotEncoder[lps];
for (slot = 0; slot < distTableSize2; slot++)
{
// posSlotPrices[slot] = RcTree_GetPrice(encoder, kNumPosSlotBits, slot, p->ProbPrices);
UInt32 price;
unsigned bit;
unsigned sym = slot + (1 << (kNumPosSlotBits - 1));
unsigned prob;
bit = sym & 1; sym >>= 1; price = GET_PRICEa(probs[sym], bit);
bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[sym], bit);
bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[sym], bit);
bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[sym], bit);
bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[sym], bit);
prob = probs[(size_t)slot + (1 << (kNumPosSlotBits - 1))];
posSlotPrices[(size_t)slot * 2 ] = price + GET_PRICEa_0(prob);
posSlotPrices[(size_t)slot * 2 + 1] = price + GET_PRICEa_1(prob);
}
{
UInt32 delta = ((UInt32)((kEndPosModelIndex / 2 - 1) - kNumAlignBits) << kNumBitPriceShiftBits);
for (slot = kEndPosModelIndex / 2; slot < distTableSize2; slot++)
{
posSlotPrices[(size_t)slot * 2 ] += delta;
posSlotPrices[(size_t)slot * 2 + 1] += delta;
delta += ((UInt32)1 << kNumBitPriceShiftBits);
}
}
{
UInt32 *dp = p->distancesPrices[lps];
dp[0] = posSlotPrices[0];
dp[1] = posSlotPrices[1];
dp[2] = posSlotPrices[2];
dp[3] = posSlotPrices[3];
for (i = 4; i < kNumFullDistances; i += 2)
{
UInt32 slotPrice = posSlotPrices[GetPosSlot1(i)];
dp[i ] = slotPrice + tempPrices[i];
dp[i + 1] = slotPrice + tempPrices[i + 1];
}
}
}
// }
}
void LzmaEnc_Construct(CLzmaEnc *p)
{
RangeEnc_Construct(&p->rc);
MatchFinder_Construct(&p->matchFinderBase);
{
CLzmaEncProps props;
LzmaEncProps_Init(&props);
LzmaEnc_SetProps(p, &props);
}
#ifndef LZMA_LOG_BSR
LzmaEnc_FastPosInit(p->g_FastPos);
#endif
LzmaEnc_InitPriceTables(p->ProbPrices);
p->litProbs = NULL;
p->saveState.litProbs = NULL;
}
CLzmaEncHandle LzmaEnc_Create(ISzAllocPtr alloc)
{
void *p;
p = ISzAlloc_Alloc(alloc, sizeof(CLzmaEnc));
if (p)
LzmaEnc_Construct((CLzmaEnc *)p);
return p;
}
void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAllocPtr alloc)
{
ISzAlloc_Free(alloc, p->litProbs);
ISzAlloc_Free(alloc, p->saveState.litProbs);
p->litProbs = NULL;
p->saveState.litProbs = NULL;
}
void LzmaEnc_Destruct(CLzmaEnc *p, ISzAllocPtr alloc, ISzAllocPtr allocBig)
{
MatchFinder_Free(&p->matchFinderBase, allocBig);
LzmaEnc_FreeLits(p, alloc);
RangeEnc_Free(&p->rc, alloc);
}
void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAllocPtr alloc, ISzAllocPtr allocBig)
{
LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig);
ISzAlloc_Free(alloc, p);
}
static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, UInt32 maxPackSize, UInt32 maxUnpackSize)
{
UInt32 nowPos32, startPos32;
if (p->needInit)
{
p->matchFinder.Init(p->matchFinderObj);
p->needInit = 0;
}
if (p->finished)
return p->result;
RINOK(CheckErrors(p));
nowPos32 = (UInt32)p->nowPos64;
startPos32 = nowPos32;
if (p->nowPos64 == 0)
{
unsigned numPairs;
Byte curByte;
if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)
return Flush(p, nowPos32);
ReadMatchDistances(p, &numPairs);
RangeEnc_EncodeBit_0(&p->rc, &p->isMatch[kState_Start][0]);
// p->state = kLiteralNextStates[p->state];
curByte = *(p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset);
LitEnc_Encode(&p->rc, p->litProbs, curByte);
p->additionalOffset--;
nowPos32++;
}
if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0)
for (;;)
{
UInt32 dist;
unsigned len, posState;
UInt32 range, ttt, newBound;
CLzmaProb *probs;
if (p->fastMode)
len = GetOptimumFast(p);
else
{
unsigned oci = p->optCur;
if (p->optEnd == oci)
len = GetOptimum(p, nowPos32);
else
{
const COptimal *opt = &p->opt[oci];
len = opt->len;
p->backRes = opt->dist;
p->optCur = oci + 1;
}
}
posState = (unsigned)nowPos32 & p->pbMask;
range = p->rc.range;
probs = &p->isMatch[p->state][posState];
RC_BIT_PRE(&p->rc, probs)
dist = p->backRes;
#ifdef SHOW_STAT2
printf("\n pos = %6X, len = %3u pos = %6u", nowPos32, len, dist);
#endif
if (dist == MARK_LIT)
{
Byte curByte;
const Byte *data;
unsigned state;
RC_BIT_0(&p->rc, probs);
p->rc.range = range;
data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset;
probs = LIT_PROBS(nowPos32, *(data - 1));
curByte = *data;
state = p->state;
p->state = kLiteralNextStates[state];
if (IsLitState(state))
LitEnc_Encode(&p->rc, probs, curByte);
else
LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0]));
}
else
{
RC_BIT_1(&p->rc, probs);
probs = &p->isRep[p->state];
RC_BIT_PRE(&p->rc, probs)
if (dist < LZMA_NUM_REPS)
{
RC_BIT_1(&p->rc, probs);
probs = &p->isRepG0[p->state];
RC_BIT_PRE(&p->rc, probs)
if (dist == 0)
{
RC_BIT_0(&p->rc, probs);
probs = &p->isRep0Long[p->state][posState];
RC_BIT_PRE(&p->rc, probs)
if (len != 1)
{
RC_BIT_1_BASE(&p->rc, probs);
}
else
{
RC_BIT_0_BASE(&p->rc, probs);
p->state = kShortRepNextStates[p->state];
}
}
else
{
RC_BIT_1(&p->rc, probs);
probs = &p->isRepG1[p->state];
RC_BIT_PRE(&p->rc, probs)
if (dist == 1)
{
RC_BIT_0_BASE(&p->rc, probs);
dist = p->reps[1];
}
else
{
RC_BIT_1(&p->rc, probs);
probs = &p->isRepG2[p->state];
RC_BIT_PRE(&p->rc, probs)
if (dist == 2)
{
RC_BIT_0_BASE(&p->rc, probs);
dist = p->reps[2];
}
else
{
RC_BIT_1_BASE(&p->rc, probs);
dist = p->reps[3];
p->reps[3] = p->reps[2];
}
p->reps[2] = p->reps[1];
}
p->reps[1] = p->reps[0];
p->reps[0] = dist;
}
RC_NORM(&p->rc)
p->rc.range = range;
if (len != 1)
{
LenEnc_Encode(&p->repLenProbs, &p->rc, len - LZMA_MATCH_LEN_MIN, posState);
--p->repLenEncCounter;
p->state = kRepNextStates[p->state];
}
}
else
{
unsigned posSlot;
RC_BIT_0(&p->rc, probs);
p->rc.range = range;
p->state = kMatchNextStates[p->state];
LenEnc_Encode(&p->lenProbs, &p->rc, len - LZMA_MATCH_LEN_MIN, posState);
// --p->lenEnc.counter;
dist -= LZMA_NUM_REPS;
p->reps[3] = p->reps[2];
p->reps[2] = p->reps[1];
p->reps[1] = p->reps[0];
p->reps[0] = dist + 1;
p->matchPriceCount++;
GetPosSlot(dist, posSlot);
// RcTree_Encode_PosSlot(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], posSlot);
{
UInt32 sym = (UInt32)posSlot + (1 << kNumPosSlotBits);
range = p->rc.range;
probs = p->posSlotEncoder[GetLenToPosState(len)];
do
{
CLzmaProb *prob = probs + (sym >> kNumPosSlotBits);
UInt32 bit = (sym >> (kNumPosSlotBits - 1)) & 1;
sym <<= 1;
RC_BIT(&p->rc, prob, bit);
}
while (sym < (1 << kNumPosSlotBits * 2));
p->rc.range = range;
}
if (dist >= kStartPosModelIndex)
{
unsigned footerBits = ((posSlot >> 1) - 1);
if (dist < kNumFullDistances)
{
unsigned base = ((2 | (posSlot & 1)) << footerBits);
RcTree_ReverseEncode(&p->rc, p->posEncoders + base, footerBits, (unsigned)(dist /* - base */));
}
else
{
UInt32 pos2 = (dist | 0xF) << (32 - footerBits);
range = p->rc.range;
// RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits);
/*
do
{
range >>= 1;
p->rc.low += range & (0 - ((dist >> --footerBits) & 1));
RC_NORM(&p->rc)
}
while (footerBits > kNumAlignBits);
*/
do
{
range >>= 1;
p->rc.low += range & (0 - (pos2 >> 31));
pos2 += pos2;
RC_NORM(&p->rc)
}
while (pos2 != 0xF0000000);
// RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask);
{
unsigned m = 1;
unsigned bit;
bit = dist & 1; dist >>= 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit); m = (m << 1) + bit;
bit = dist & 1; dist >>= 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit); m = (m << 1) + bit;
bit = dist & 1; dist >>= 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit); m = (m << 1) + bit;
bit = dist & 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit);
p->rc.range = range;
// p->alignPriceCount++;
}
}
}
}
}
nowPos32 += (UInt32)len;
p->additionalOffset -= len;
if (p->additionalOffset == 0)
{
UInt32 processed;
if (!p->fastMode)
{
/*
if (p->alignPriceCount >= 16) // kAlignTableSize
FillAlignPrices(p);
if (p->matchPriceCount >= 128)
FillDistancesPrices(p);
if (p->lenEnc.counter <= 0)
LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, &p->lenProbs, p->ProbPrices);
*/
if (p->matchPriceCount >= 64)
{
FillAlignPrices(p);
// { int y; for (y = 0; y < 100; y++) {
FillDistancesPrices(p);
// }}
LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, &p->lenProbs, p->ProbPrices);
}
if (p->repLenEncCounter <= 0)
{
p->repLenEncCounter = REP_LEN_COUNT;
LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, &p->repLenProbs, p->ProbPrices);
}
}
if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)
break;
processed = nowPos32 - startPos32;
if (maxPackSize)
{
if (processed + kNumOpts + 300 >= maxUnpackSize
|| RangeEnc_GetProcessed_sizet(&p->rc) + kPackReserve >= maxPackSize)
break;
}
else if (processed >= (1 << 17))
{
p->nowPos64 += nowPos32 - startPos32;
return CheckErrors(p);
}
}
}
p->nowPos64 += nowPos32 - startPos32;
return Flush(p, nowPos32);
}
#define kBigHashDicLimit ((UInt32)1 << 24)
static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig)
{
UInt32 beforeSize = kNumOpts;
if (!RangeEnc_Alloc(&p->rc, alloc))
return SZ_ERROR_MEM;
{
unsigned lclp = p->lc + p->lp;
if (!p->litProbs || !p->saveState.litProbs || p->lclp != lclp)
{
LzmaEnc_FreeLits(p, alloc);
p->litProbs = (CLzmaProb *)ISzAlloc_Alloc(alloc, ((UInt32)0x300 << lclp) * sizeof(CLzmaProb));
p->saveState.litProbs = (CLzmaProb *)ISzAlloc_Alloc(alloc, ((UInt32)0x300 << lclp) * sizeof(CLzmaProb));
if (!p->litProbs || !p->saveState.litProbs)
{
LzmaEnc_FreeLits(p, alloc);
return SZ_ERROR_MEM;
}
p->lclp = lclp;
}
}
p->matchFinderBase.bigHash = (Byte)(p->dictSize > kBigHashDicLimit ? 1 : 0);
if (beforeSize + p->dictSize < keepWindowSize)
beforeSize = keepWindowSize - p->dictSize;
{
if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig))
return SZ_ERROR_MEM;
p->matchFinderObj = &p->matchFinderBase;
MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder);
}
return SZ_OK;
}
void LzmaEnc_Init(CLzmaEnc *p)
{
unsigned i;
p->state = 0;
p->reps[0] =
p->reps[1] =
p->reps[2] =
p->reps[3] = 1;
RangeEnc_Init(&p->rc);
for (i = 0; i < (1 << kNumAlignBits); i++)
p->posAlignEncoder[i] = kProbInitValue;
for (i = 0; i < kNumStates; i++)
{
unsigned j;
for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++)
{
p->isMatch[i][j] = kProbInitValue;
p->isRep0Long[i][j] = kProbInitValue;
}
p->isRep[i] = kProbInitValue;
p->isRepG0[i] = kProbInitValue;
p->isRepG1[i] = kProbInitValue;
p->isRepG2[i] = kProbInitValue;
}
{
for (i = 0; i < kNumLenToPosStates; i++)
{
CLzmaProb *probs = p->posSlotEncoder[i];
unsigned j;
for (j = 0; j < (1 << kNumPosSlotBits); j++)
probs[j] = kProbInitValue;
}
}
{
for (i = 0; i < kNumFullDistances; i++)
p->posEncoders[i] = kProbInitValue;
}
{
UInt32 num = (UInt32)0x300 << (p->lp + p->lc);
UInt32 k;
CLzmaProb *probs = p->litProbs;
for (k = 0; k < num; k++)
probs[k] = kProbInitValue;
}
LenEnc_Init(&p->lenProbs);
LenEnc_Init(&p->repLenProbs);
p->optEnd = 0;
p->optCur = 0;
{
for (i = 0; i < kNumOpts; i++)
p->opt[i].price = kInfinityPrice;
}
p->additionalOffset = 0;
p->pbMask = (1 << p->pb) - 1;
p->lpMask = ((UInt32)0x100 << p->lp) - ((unsigned)0x100 >> p->lc);
}
void LzmaEnc_InitPrices(CLzmaEnc *p)
{
if (!p->fastMode)
{
FillDistancesPrices(p);
FillAlignPrices(p);
}
p->lenEnc.tableSize =
p->repLenEnc.tableSize =
p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN;
p->repLenEncCounter = REP_LEN_COUNT;
LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, &p->lenProbs, p->ProbPrices);
LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, &p->repLenProbs, p->ProbPrices);
}
static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig)
{
unsigned i;
for (i = kEndPosModelIndex / 2; i < kDicLogSizeMax; i++)
if (p->dictSize <= ((UInt32)1 << i))
break;
p->distTableSize = i * 2;
p->finished = False;
p->result = SZ_OK;
RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig));
LzmaEnc_Init(p);
LzmaEnc_InitPrices(p);
p->nowPos64 = 0;
return SZ_OK;
}
static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream,
ISzAllocPtr alloc, ISzAllocPtr allocBig)
{
CLzmaEnc *p = (CLzmaEnc *)pp;
p->matchFinderBase.stream = inStream;
p->needInit = 1;
p->rc.outStream = outStream;
return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig);
}
SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp,
ISeqInStream *inStream, UInt32 keepWindowSize,
ISzAllocPtr alloc, ISzAllocPtr allocBig)
{
CLzmaEnc *p = (CLzmaEnc *)pp;
p->matchFinderBase.stream = inStream;
p->needInit = 1;
return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig);
}
static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen)
{
p->matchFinderBase.directInput = 1;
p->matchFinderBase.bufferBase = (Byte *)src;
p->matchFinderBase.directInputRem = srcLen;
}
SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen,
UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig)
{
CLzmaEnc *p = (CLzmaEnc *)pp;
LzmaEnc_SetInputBuf(p, src, srcLen);
p->needInit = 1;
LzmaEnc_SetDataSize(pp, srcLen);
return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig);
}
void LzmaEnc_Finish(CLzmaEncHandle pp)
{
UNUSED_VAR(pp)
}
typedef struct
{
ISeqOutStream vt;
Byte *data;
SizeT rem;
BoolInt overflow;
} CLzmaEnc_SeqOutStreamBuf;
static size_t SeqOutStreamBuf_Write(const ISeqOutStream *pp, const void *data, size_t size)
{
CLzmaEnc_SeqOutStreamBuf *p = CONTAINER_FROM_VTBL(pp, CLzmaEnc_SeqOutStreamBuf, vt);
if (p->rem < size)
{
size = p->rem;
p->overflow = True;
}
memcpy(p->data, data, size);
p->rem -= size;
p->data += size;
return size;
}
UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp)
{
const CLzmaEnc *p = (CLzmaEnc *)pp;
return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);
}
const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp)
{
const CLzmaEnc *p = (CLzmaEnc *)pp;
return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset;
}
SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit,
Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize)
{
CLzmaEnc *p = (CLzmaEnc *)pp;
UInt64 nowPos64;
SRes res;
CLzmaEnc_SeqOutStreamBuf outStream;
outStream.vt.Write = SeqOutStreamBuf_Write;
outStream.data = dest;
outStream.rem = *destLen;
outStream.overflow = False;
p->writeEndMark = False;
p->finished = False;
p->result = SZ_OK;
if (reInit)
LzmaEnc_Init(p);
LzmaEnc_InitPrices(p);
nowPos64 = p->nowPos64;
RangeEnc_Init(&p->rc);
p->rc.outStream = &outStream.vt;
if (desiredPackSize == 0)
return SZ_ERROR_OUTPUT_EOF;
res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize);
*unpackSize = (UInt32)(p->nowPos64 - nowPos64);
*destLen -= outStream.rem;
if (outStream.overflow)
return SZ_ERROR_OUTPUT_EOF;
return res;
}
static SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgress *progress)
{
SRes res = SZ_OK;
for (;;)
{
res = LzmaEnc_CodeOneBlock(p, 0, 0);
if (res != SZ_OK || p->finished)
break;
if (progress)
{
res = ICompressProgress_Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc));
if (res != SZ_OK)
{
res = SZ_ERROR_PROGRESS;
break;
}
}
}
LzmaEnc_Finish(p);
/*
if (res == SZ_OK && !Inline_MatchFinder_IsFinishedOK(&p->matchFinderBase))
res = SZ_ERROR_FAIL;
}
*/
return res;
}
SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress,
ISzAllocPtr alloc, ISzAllocPtr allocBig)
{
RINOK(LzmaEnc_Prepare(pp, outStream, inStream, alloc, allocBig));
return LzmaEnc_Encode2((CLzmaEnc *)pp, progress);
}
SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size)
{
CLzmaEnc *p = (CLzmaEnc *)pp;
unsigned i;
UInt32 dictSize = p->dictSize;
if (*size < LZMA_PROPS_SIZE)
return SZ_ERROR_PARAM;
*size = LZMA_PROPS_SIZE;
props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc);
if (dictSize >= ((UInt32)1 << 22))
{
UInt32 kDictMask = ((UInt32)1 << 20) - 1;
if (dictSize < (UInt32)0xFFFFFFFF - kDictMask)
dictSize = (dictSize + kDictMask) & ~kDictMask;
}
else for (i = 11; i <= 30; i++)
{
if (dictSize <= ((UInt32)2 << i)) { dictSize = (2 << i); break; }
if (dictSize <= ((UInt32)3 << i)) { dictSize = (3 << i); break; }
}
for (i = 0; i < 4; i++)
props[1 + i] = (Byte)(dictSize >> (8 * i));
return SZ_OK;
}
unsigned LzmaEnc_IsWriteEndMark(CLzmaEncHandle pp)
{
return ((CLzmaEnc *)pp)->writeEndMark;
}
SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
int writeEndMark, ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig)
{
SRes res;
CLzmaEnc *p = (CLzmaEnc *)pp;
CLzmaEnc_SeqOutStreamBuf outStream;
outStream.vt.Write = SeqOutStreamBuf_Write;
outStream.data = dest;
outStream.rem = *destLen;
outStream.overflow = False;
p->writeEndMark = writeEndMark;
p->rc.outStream = &outStream.vt;
res = LzmaEnc_MemPrepare(pp, src, srcLen, 0, alloc, allocBig);
if (res == SZ_OK)
{
res = LzmaEnc_Encode2(p, progress);
if (res == SZ_OK && p->nowPos64 != srcLen)
res = SZ_ERROR_FAIL;
}
*destLen -= outStream.rem;
if (outStream.overflow)
return SZ_ERROR_OUTPUT_EOF;
return res;
}
SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig)
{
CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc);
SRes res;
if (!p)
return SZ_ERROR_MEM;
res = LzmaEnc_SetProps(p, props);
if (res == SZ_OK)
{
res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize);
if (res == SZ_OK)
res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen,
writeEndMark, progress, alloc, allocBig);
}
LzmaEnc_Destroy(p, alloc, allocBig);
return res;
}
/*** End of inlined file: LzmaEnc.c ***/
/*** Start of inlined file: LzFind.c ***/
//#include <string.h>
/*** Start of inlined file: LzHash.h ***/
#ifndef __LZ_HASH_H
#define __LZ_HASH_H
#define kHash2Size (1 << 10)
#define kHash3Size (1 << 16)
#define kHash4Size (1 << 20)
#define kFix3HashSize (kHash2Size)
#define kFix4HashSize (kHash2Size + kHash3Size)
#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size)
#define HASH2_CALC hv = cur[0] | ((UInt32)cur[1] << 8);
#define HASH3_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
h2 = temp & (kHash2Size - 1); \
hv = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; }
#define HASH4_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
h2 = temp & (kHash2Size - 1); \
temp ^= ((UInt32)cur[2] << 8); \
h3 = temp & (kHash3Size - 1); \
hv = (temp ^ (p->crc[cur[3]] << 5)) & p->hashMask; }
#define HASH5_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
h2 = temp & (kHash2Size - 1); \
temp ^= ((UInt32)cur[2] << 8); \
h3 = temp & (kHash3Size - 1); \
temp ^= (p->crc[cur[3]] << 5); \
h4 = temp & (kHash4Size - 1); \
hv = (temp ^ (p->crc[cur[4]] << 3)) & p->hashMask; }
/* #define HASH_ZIP_CALC hv = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */
#define HASH_ZIP_CALC hv = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;
#define MT_HASH2_CALC \
h2 = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1);
#define MT_HASH3_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
h2 = temp & (kHash2Size - 1); \
h3 = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); }
#define MT_HASH4_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
h2 = temp & (kHash2Size - 1); \
temp ^= ((UInt32)cur[2] << 8); \
h3 = temp & (kHash3Size - 1); \
h4 = (temp ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); }
#endif
/*** End of inlined file: LzHash.h ***/
#define kEmptyHashValue 0
#define kMaxValForNormalize ((UInt32)0xFFFFFFFF)
#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */
#define kNormalizeMask (~(UInt32)(kNormalizeStepMin - 1))
#define kMaxHistorySize ((UInt32)7 << 29)
#define kStartMaxLen 3
static void LzInWindow_Free(CMatchFinder *p, ISzAllocPtr alloc)
{
if (!p->directInput)
{
ISzAlloc_Free(alloc, p->bufferBase);
p->bufferBase = NULL;
}
}
/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */
static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAllocPtr alloc)
{
UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv;
if (p->directInput)
{
p->blockSize = blockSize;
return 1;
}
if (!p->bufferBase || p->blockSize != blockSize)
{
LzInWindow_Free(p, alloc);
p->blockSize = blockSize;
p->bufferBase = (Byte *)ISzAlloc_Alloc(alloc, (size_t)blockSize);
}
return (p->bufferBase != NULL);
}
Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; }
UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; }
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue)
{
p->posLimit -= subValue;
p->pos -= subValue;
p->streamPos -= subValue;
}
static void MatchFinder_ReadBlock(CMatchFinder *p)
{
if (p->streamEndWasReached || p->result != SZ_OK)
return;
/* We use (p->streamPos - p->pos) value. (p->streamPos < p->pos) is allowed. */
if (p->directInput)
{
UInt32 curSize = 0xFFFFFFFF - (p->streamPos - p->pos);
if (curSize > p->directInputRem)
curSize = (UInt32)p->directInputRem;
p->directInputRem -= curSize;
p->streamPos += curSize;
if (p->directInputRem == 0)
p->streamEndWasReached = 1;
return;
}
for (;;)
{
Byte *dest = p->buffer + (p->streamPos - p->pos);
size_t size = (p->bufferBase + p->blockSize - dest);
if (size == 0)
return;
p->result = ISeqInStream_Read(p->stream, dest, &size);
if (p->result != SZ_OK)
return;
if (size == 0)
{
p->streamEndWasReached = 1;
return;
}
p->streamPos += (UInt32)size;
if (p->streamPos - p->pos > p->keepSizeAfter)
return;
}
}
void MatchFinder_MoveBlock(CMatchFinder *p)
{
memmove(p->bufferBase,
p->buffer - p->keepSizeBefore,
(size_t)(p->streamPos - p->pos) + p->keepSizeBefore);
p->buffer = p->bufferBase + p->keepSizeBefore;
}
int MatchFinder_NeedMove(CMatchFinder *p)
{
if (p->directInput)
return 0;
/* if (p->streamEndWasReached) return 0; */
return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter);
}
void MatchFinder_ReadIfRequired(CMatchFinder *p)
{
if (p->streamEndWasReached)
return;
if (p->keepSizeAfter >= p->streamPos - p->pos)
MatchFinder_ReadBlock(p);
}
static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p)
{
if (MatchFinder_NeedMove(p))
MatchFinder_MoveBlock(p);
MatchFinder_ReadBlock(p);
}
static void MatchFinder_SetDefaultSettings(CMatchFinder *p)
{
p->cutValue = 32;
p->btMode = 1;
p->numHashBytes = 4;
p->bigHash = 0;
}
#define kCrcPoly 0xEDB88320
void MatchFinder_Construct(CMatchFinder *p)
{
unsigned i;
p->bufferBase = NULL;
p->directInput = 0;
p->hash = NULL;
p->expectedDataSize = (UInt64)(Int64)-1;
MatchFinder_SetDefaultSettings(p);
for (i = 0; i < 256; i++)
{
UInt32 r = (UInt32)i;
unsigned j;
for (j = 0; j < 8; j++)
r = (r >> 1) ^ (kCrcPoly & ((UInt32)0 - (r & 1)));
p->crc[i] = r;
}
}
static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAllocPtr alloc)
{
ISzAlloc_Free(alloc, p->hash);
p->hash = NULL;
}
void MatchFinder_Free(CMatchFinder *p, ISzAllocPtr alloc)
{
MatchFinder_FreeThisClassMemory(p, alloc);
LzInWindow_Free(p, alloc);
}
static CLzRef* AllocRefs(size_t num, ISzAllocPtr alloc)
{
size_t sizeInBytes = (size_t)num * sizeof(CLzRef);
if (sizeInBytes / sizeof(CLzRef) != num)
return NULL;
return (CLzRef *)ISzAlloc_Alloc(alloc, sizeInBytes);
}
int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
ISzAllocPtr alloc)
{
UInt32 sizeReserv;
if (historySize > kMaxHistorySize)
{
MatchFinder_Free(p, alloc);
return 0;
}
sizeReserv = historySize >> 1;
if (historySize >= ((UInt32)3 << 30)) sizeReserv = historySize >> 3;
else if (historySize >= ((UInt32)2 << 30)) sizeReserv = historySize >> 2;
sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19);
p->keepSizeBefore = historySize + keepAddBufferBefore + 1;
p->keepSizeAfter = matchMaxLen + keepAddBufferAfter;
/* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */
if (LzInWindow_Create(p, sizeReserv, alloc))
{
UInt32 newCyclicBufferSize = historySize + 1;
UInt32 hs;
p->matchMaxLen = matchMaxLen;
{
p->fixedHashSize = 0;
if (p->numHashBytes == 2)
hs = (1 << 16) - 1;
else
{
hs = historySize;
if (hs > p->expectedDataSize)
hs = (UInt32)p->expectedDataSize;
if (hs != 0)
hs--;
hs |= (hs >> 1);
hs |= (hs >> 2);
hs |= (hs >> 4);
hs |= (hs >> 8);
hs >>= 1;
hs |= 0xFFFF; /* don't change it! It's required for Deflate */
if (hs > (1 << 24))
{
if (p->numHashBytes == 3)
hs = (1 << 24) - 1;
else
hs >>= 1;
/* if (bigHash) mode, GetHeads4b() in LzFindMt.c needs (hs >= ((1 << 24) - 1))) */
}
}
p->hashMask = hs;
hs++;
if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size;
if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size;
if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size;
hs += p->fixedHashSize;
}
{
size_t newSize;
size_t numSons;
p->historySize = historySize;
p->hashSizeSum = hs;
p->cyclicBufferSize = newCyclicBufferSize;
numSons = newCyclicBufferSize;
if (p->btMode)
numSons <<= 1;
newSize = hs + numSons;
if (p->hash && p->numRefs == newSize)
return 1;
MatchFinder_FreeThisClassMemory(p, alloc);
p->numRefs = newSize;
p->hash = AllocRefs(newSize, alloc);
if (p->hash)
{
p->son = p->hash + p->hashSizeSum;
return 1;
}
}
}
MatchFinder_Free(p, alloc);
return 0;
}
static void MatchFinder_SetLimits(CMatchFinder *p)
{
UInt32 limit = kMaxValForNormalize - p->pos;
UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos;
if (limit2 < limit)
limit = limit2;
limit2 = p->streamPos - p->pos;
if (limit2 <= p->keepSizeAfter)
{
if (limit2 > 0)
limit2 = 1;
}
else
limit2 -= p->keepSizeAfter;
if (limit2 < limit)
limit = limit2;
{
UInt32 lenLimit = p->streamPos - p->pos;
if (lenLimit > p->matchMaxLen)
lenLimit = p->matchMaxLen;
p->lenLimit = lenLimit;
}
p->posLimit = p->pos + limit;
}
void MatchFinder_Init_LowHash(CMatchFinder *p)
{
size_t i;
CLzRef *items = p->hash;
size_t numItems = p->fixedHashSize;
for (i = 0; i < numItems; i++)
items[i] = kEmptyHashValue;
}
void MatchFinder_Init_HighHash(CMatchFinder *p)
{
size_t i;
CLzRef *items = p->hash + p->fixedHashSize;
size_t numItems = (size_t)p->hashMask + 1;
for (i = 0; i < numItems; i++)
items[i] = kEmptyHashValue;
}
void MatchFinder_Init_3(CMatchFinder *p, int readData)
{
p->cyclicBufferPos = 0;
p->buffer = p->bufferBase;
p->pos =
p->streamPos = p->cyclicBufferSize;
p->result = SZ_OK;
p->streamEndWasReached = 0;
if (readData)
MatchFinder_ReadBlock(p);
MatchFinder_SetLimits(p);
}
void MatchFinder_Init(CMatchFinder *p)
{
MatchFinder_Init_HighHash(p);
MatchFinder_Init_LowHash(p);
MatchFinder_Init_3(p, True);
}
static UInt32 MatchFinder_GetSubValue(CMatchFinder *p)
{
return (p->pos - p->historySize - 1) & kNormalizeMask;
}
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems)
{
size_t i;
for (i = 0; i < numItems; i++)
{
UInt32 value = items[i];
if (value <= subValue)
value = kEmptyHashValue;
else
value -= subValue;
items[i] = value;
}
}
static void MatchFinder_Normalize(CMatchFinder *p)
{
UInt32 subValue = MatchFinder_GetSubValue(p);
MatchFinder_Normalize3(subValue, p->hash, p->numRefs);
MatchFinder_ReduceOffsets(p, subValue);
}
MY_NO_INLINE
static void MatchFinder_CheckLimits(CMatchFinder *p)
{
if (p->pos == kMaxValForNormalize)
MatchFinder_Normalize(p);
if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos)
MatchFinder_CheckAndMoveAndRead(p);
if (p->cyclicBufferPos == p->cyclicBufferSize)
p->cyclicBufferPos = 0;
MatchFinder_SetLimits(p);
}
/*
(lenLimit > maxLen)
*/
MY_FORCE_INLINE
static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
UInt32 *distances, unsigned maxLen)
{
/*
son[_cyclicBufferPos] = curMatch;
for (;;)
{
UInt32 delta = pos - curMatch;
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
return distances;
{
const Byte *pb = cur - delta;
curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)];
if (pb[maxLen] == cur[maxLen] && *pb == *cur)
{
UInt32 len = 0;
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
if (maxLen < len)
{
maxLen = len;
*distances++ = len;
*distances++ = delta - 1;
if (len == lenLimit)
return distances;
}
}
}
}
*/
const Byte *lim = cur + lenLimit;
son[_cyclicBufferPos] = curMatch;
do
{
UInt32 delta = pos - curMatch;
if (delta >= _cyclicBufferSize)
break;
{
ptrdiff_t diff;
curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)];
diff = (ptrdiff_t)0 - delta;
if (cur[maxLen] == cur[maxLen + diff])
{
const Byte *c = cur;
while (*c == c[diff])
{
if (++c == lim)
{
distances[0] = (UInt32)(lim - cur);
distances[1] = delta - 1;
return distances + 2;
}
}
{
unsigned len = (unsigned)(c - cur);
if (maxLen < len)
{
maxLen = len;
distances[0] = (UInt32)len;
distances[1] = delta - 1;
distances += 2;
}
}
}
}
}
while (--cutValue);
return distances;
}
MY_FORCE_INLINE
UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
UInt32 *distances, UInt32 maxLen)
{
CLzRef *ptr0 = son + ((size_t)_cyclicBufferPos << 1) + 1;
CLzRef *ptr1 = son + ((size_t)_cyclicBufferPos << 1);
unsigned len0 = 0, len1 = 0;
for (;;)
{
UInt32 delta = pos - curMatch;
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
{
*ptr0 = *ptr1 = kEmptyHashValue;
return distances;
}
{
CLzRef *pair = son + ((size_t)(_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
const Byte *pb = cur - delta;
unsigned len = (len0 < len1 ? len0 : len1);
UInt32 pair0 = pair[0];
if (pb[len] == cur[len])
{
if (++len != lenLimit && pb[len] == cur[len])
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
if (maxLen < len)
{
maxLen = (UInt32)len;
*distances++ = (UInt32)len;
*distances++ = delta - 1;
if (len == lenLimit)
{
*ptr1 = pair0;
*ptr0 = pair[1];
return distances;
}
}
}
if (pb[len] < cur[len])
{
*ptr1 = curMatch;
ptr1 = pair + 1;
curMatch = *ptr1;
len1 = len;
}
else
{
*ptr0 = curMatch;
ptr0 = pair;
curMatch = *ptr0;
len0 = len;
}
}
}
}
static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue)
{
CLzRef *ptr0 = son + ((size_t)_cyclicBufferPos << 1) + 1;
CLzRef *ptr1 = son + ((size_t)_cyclicBufferPos << 1);
unsigned len0 = 0, len1 = 0;
for (;;)
{
UInt32 delta = pos - curMatch;
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
{
*ptr0 = *ptr1 = kEmptyHashValue;
return;
}
{
CLzRef *pair = son + ((size_t)(_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
const Byte *pb = cur - delta;
unsigned len = (len0 < len1 ? len0 : len1);
if (pb[len] == cur[len])
{
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
{
if (len == lenLimit)
{
*ptr1 = pair[0];
*ptr0 = pair[1];
return;
}
}
}
if (pb[len] < cur[len])
{
*ptr1 = curMatch;
ptr1 = pair + 1;
curMatch = *ptr1;
len1 = len;
}
else
{
*ptr0 = curMatch;
ptr0 = pair;
curMatch = *ptr0;
len0 = len;
}
}
}
}
#define MOVE_POS \
++p->cyclicBufferPos; \
p->buffer++; \
if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);
#define MOVE_POS_RET MOVE_POS return (UInt32)offset;
static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }
#define GET_MATCHES_HEADER2(minLen, ret_op) \
unsigned lenLimit; UInt32 hv; const Byte *cur; UInt32 curMatch; \
lenLimit = (unsigned)p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \
cur = p->buffer;
#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0)
#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue)
#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue
#define GET_MATCHES_FOOTER(offset, maxLen) \
offset = (unsigned)(GetMatchesSpec1((UInt32)lenLimit, curMatch, MF_PARAMS(p), \
distances + offset, (UInt32)maxLen) - distances); MOVE_POS_RET;
#define SKIP_FOOTER \
SkipMatchesSpec((UInt32)lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;
#define UPDATE_maxLen { \
ptrdiff_t diff = (ptrdiff_t)0 - d2; \
const Byte *c = cur + maxLen; \
const Byte *lim = cur + lenLimit; \
for (; c != lim; c++) if (*(c + diff) != *c) break; \
maxLen = (unsigned)(c - cur); }
static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
unsigned offset;
GET_MATCHES_HEADER(2)
HASH2_CALC;
curMatch = p->hash[hv];
p->hash[hv] = p->pos;
offset = 0;
GET_MATCHES_FOOTER(offset, 1)
}
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
unsigned offset;
GET_MATCHES_HEADER(3)
HASH_ZIP_CALC;
curMatch = p->hash[hv];
p->hash[hv] = p->pos;
offset = 0;
GET_MATCHES_FOOTER(offset, 2)
}
static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 h2, d2, pos;
unsigned maxLen, offset;
UInt32 *hash;
GET_MATCHES_HEADER(3)
HASH3_CALC;
hash = p->hash;
pos = p->pos;
d2 = pos - hash[h2];
curMatch = (hash + kFix3HashSize)[hv];
hash[h2] = pos;
(hash + kFix3HashSize)[hv] = pos;
maxLen = 2;
offset = 0;
if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur)
{
UPDATE_maxLen
distances[0] = (UInt32)maxLen;
distances[1] = d2 - 1;
offset = 2;
if (maxLen == lenLimit)
{
SkipMatchesSpec((UInt32)lenLimit, curMatch, MF_PARAMS(p));
MOVE_POS_RET;
}
}
GET_MATCHES_FOOTER(offset, maxLen)
}
static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 h2, h3, d2, d3, pos;
unsigned maxLen, offset;
UInt32 *hash;
GET_MATCHES_HEADER(4)
HASH4_CALC;
hash = p->hash;
pos = p->pos;
d2 = pos - hash [h2];
d3 = pos - (hash + kFix3HashSize)[h3];
curMatch = (hash + kFix4HashSize)[hv];
hash [h2] = pos;
(hash + kFix3HashSize)[h3] = pos;
(hash + kFix4HashSize)[hv] = pos;
maxLen = 0;
offset = 0;
if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur)
{
maxLen = 2;
distances[0] = 2;
distances[1] = d2 - 1;
offset = 2;
}
if (d2 != d3 && d3 < p->cyclicBufferSize && *(cur - d3) == *cur)
{
maxLen = 3;
distances[(size_t)offset + 1] = d3 - 1;
offset += 2;
d2 = d3;
}
if (offset != 0)
{
UPDATE_maxLen
distances[(size_t)offset - 2] = (UInt32)maxLen;
if (maxLen == lenLimit)
{
SkipMatchesSpec((UInt32)lenLimit, curMatch, MF_PARAMS(p));
MOVE_POS_RET;
}
}
if (maxLen < 3)
maxLen = 3;
GET_MATCHES_FOOTER(offset, maxLen)
}
/*
static UInt32 Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 h2, h3, h4, d2, d3, d4, maxLen, offset, pos;
UInt32 *hash;
GET_MATCHES_HEADER(5)
HASH5_CALC;
hash = p->hash;
pos = p->pos;
d2 = pos - hash [h2];
d3 = pos - (hash + kFix3HashSize)[h3];
d4 = pos - (hash + kFix4HashSize)[h4];
curMatch = (hash + kFix5HashSize)[hv];
hash [h2] = pos;
(hash + kFix3HashSize)[h3] = pos;
(hash + kFix4HashSize)[h4] = pos;
(hash + kFix5HashSize)[hv] = pos;
maxLen = 0;
offset = 0;
if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur)
{
distances[0] = maxLen = 2;
distances[1] = d2 - 1;
offset = 2;
if (*(cur - d2 + 2) == cur[2])
distances[0] = maxLen = 3;
else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur)
{
distances[2] = maxLen = 3;
distances[3] = d3 - 1;
offset = 4;
d2 = d3;
}
}
else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur)
{
distances[0] = maxLen = 3;
distances[1] = d3 - 1;
offset = 2;
d2 = d3;
}
if (d2 != d4 && d4 < p->cyclicBufferSize
&& *(cur - d4) == *cur
&& *(cur - d4 + 3) == *(cur + 3))
{
maxLen = 4;
distances[(size_t)offset + 1] = d4 - 1;
offset += 2;
d2 = d4;
}
if (offset != 0)
{
UPDATE_maxLen
distances[(size_t)offset - 2] = maxLen;
if (maxLen == lenLimit)
{
SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
MOVE_POS_RET;
}
}
if (maxLen < 4)
maxLen = 4;
GET_MATCHES_FOOTER(offset, maxLen)
}
*/
static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 h2, h3, d2, d3, pos;
unsigned maxLen, offset;
UInt32 *hash;
GET_MATCHES_HEADER(4)
HASH4_CALC;
hash = p->hash;
pos = p->pos;
d2 = pos - hash [h2];
d3 = pos - (hash + kFix3HashSize)[h3];
curMatch = (hash + kFix4HashSize)[hv];
hash [h2] = pos;
(hash + kFix3HashSize)[h3] = pos;
(hash + kFix4HashSize)[hv] = pos;
maxLen = 0;
offset = 0;
if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur)
{
maxLen = 2;
distances[0] = 2;
distances[1] = d2 - 1;
offset = 2;
}
if (d2 != d3 && d3 < p->cyclicBufferSize && *(cur - d3) == *cur)
{
maxLen = 3;
distances[(size_t)offset + 1] = d3 - 1;
offset += 2;
d2 = d3;
}
if (offset != 0)
{
UPDATE_maxLen
distances[(size_t)offset - 2] = (UInt32)maxLen;
if (maxLen == lenLimit)
{
p->son[p->cyclicBufferPos] = curMatch;
MOVE_POS_RET;
}
}
if (maxLen < 3)
maxLen = 3;
offset = (unsigned)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
distances + offset, maxLen) - (distances));
MOVE_POS_RET
}
/*
static UInt32 Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 h2, h3, h4, d2, d3, d4, maxLen, offset, pos
UInt32 *hash;
GET_MATCHES_HEADER(5)
HASH5_CALC;
hash = p->hash;
pos = p->pos;
d2 = pos - hash [h2];
d3 = pos - (hash + kFix3HashSize)[h3];
d4 = pos - (hash + kFix4HashSize)[h4];
curMatch = (hash + kFix5HashSize)[hv];
hash [h2] = pos;
(hash + kFix3HashSize)[h3] = pos;
(hash + kFix4HashSize)[h4] = pos;
(hash + kFix5HashSize)[hv] = pos;
maxLen = 0;
offset = 0;
if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur)
{
distances[0] = maxLen = 2;
distances[1] = d2 - 1;
offset = 2;
if (*(cur - d2 + 2) == cur[2])
distances[0] = maxLen = 3;
else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur)
{
distances[2] = maxLen = 3;
distances[3] = d3 - 1;
offset = 4;
d2 = d3;
}
}
else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur)
{
distances[0] = maxLen = 3;
distances[1] = d3 - 1;
offset = 2;
d2 = d3;
}
if (d2 != d4 && d4 < p->cyclicBufferSize
&& *(cur - d4) == *cur
&& *(cur - d4 + 3) == *(cur + 3))
{
maxLen = 4;
distances[(size_t)offset + 1] = d4 - 1;
offset += 2;
d2 = d4;
}
if (offset != 0)
{
UPDATE_maxLen
distances[(size_t)offset - 2] = maxLen;
if (maxLen == lenLimit)
{
p->son[p->cyclicBufferPos] = curMatch;
MOVE_POS_RET;
}
}
if (maxLen < 4)
maxLen = 4;
offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
distances + offset, maxLen) - (distances));
MOVE_POS_RET
}
*/
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
unsigned offset;
GET_MATCHES_HEADER(3)
HASH_ZIP_CALC;
curMatch = p->hash[hv];
p->hash[hv] = p->pos;
offset = (unsigned)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
distances, 2) - (distances));
MOVE_POS_RET
}
static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
SKIP_HEADER(2)
HASH2_CALC;
curMatch = p->hash[hv];
p->hash[hv] = p->pos;
SKIP_FOOTER
}
while (--num != 0);
}
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
SKIP_HEADER(3)
HASH_ZIP_CALC;
curMatch = p->hash[hv];
p->hash[hv] = p->pos;
SKIP_FOOTER
}
while (--num != 0);
}
static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
UInt32 h2;
UInt32 *hash;
SKIP_HEADER(3)
HASH3_CALC;
hash = p->hash;
curMatch = (hash + kFix3HashSize)[hv];
hash[h2] =
(hash + kFix3HashSize)[hv] = p->pos;
SKIP_FOOTER
}
while (--num != 0);
}
static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
UInt32 h2, h3;
UInt32 *hash;
SKIP_HEADER(4)
HASH4_CALC;
hash = p->hash;
curMatch = (hash + kFix4HashSize)[hv];
hash [h2] =
(hash + kFix3HashSize)[h3] =
(hash + kFix4HashSize)[hv] = p->pos;
SKIP_FOOTER
}
while (--num != 0);
}
/*
static void Bt5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
UInt32 h2, h3, h4;
UInt32 *hash;
SKIP_HEADER(5)
HASH5_CALC;
hash = p->hash;
curMatch = (hash + kFix5HashSize)[hv];
hash [h2] =
(hash + kFix3HashSize)[h3] =
(hash + kFix4HashSize)[h4] =
(hash + kFix5HashSize)[hv] = p->pos;
SKIP_FOOTER
}
while (--num != 0);
}
*/
static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
UInt32 h2, h3;
UInt32 *hash;
SKIP_HEADER(4)
HASH4_CALC;
hash = p->hash;
curMatch = (hash + kFix4HashSize)[hv];
hash [h2] =
(hash + kFix3HashSize)[h3] =
(hash + kFix4HashSize)[hv] = p->pos;
p->son[p->cyclicBufferPos] = curMatch;
MOVE_POS
}
while (--num != 0);
}
/*
static void Hc5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
UInt32 h2, h3, h4;
UInt32 *hash;
SKIP_HEADER(5)
HASH5_CALC;
hash = p->hash;
curMatch = hash + kFix5HashSize)[hv];
hash [h2] =
(hash + kFix3HashSize)[h3] =
(hash + kFix4HashSize)[h4] =
(hash + kFix5HashSize)[hv] = p->pos;
p->son[p->cyclicBufferPos] = curMatch;
MOVE_POS
}
while (--num != 0);
}
*/
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
SKIP_HEADER(3)
HASH_ZIP_CALC;
curMatch = p->hash[hv];
p->hash[hv] = p->pos;
p->son[p->cyclicBufferPos] = curMatch;
MOVE_POS
}
while (--num != 0);
}
void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable)
{
vTable->Init = (Mf_Init_Func)MatchFinder_Init;
vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes;
vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos;
if (!p->btMode)
{
/* if (p->numHashBytes <= 4) */
{
vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip;
}
/*
else
{
vTable->GetMatches = (Mf_GetMatches_Func)Hc5_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Hc5_MatchFinder_Skip;
}
*/
}
else if (p->numHashBytes == 2)
{
vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip;
}
else if (p->numHashBytes == 3)
{
vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip;
}
else /* if (p->numHashBytes == 4) */
{
vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip;
}
/*
else
{
vTable->GetMatches = (Mf_GetMatches_Func)Bt5_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Bt5_MatchFinder_Skip;
}
*/
}
/*** End of inlined file: LzFind.c ***/
/*** Start of inlined file: LzmaLib.c ***/
MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
unsigned char *outProps, size_t *outPropsSize,
int level, /* 0 <= level <= 9, default = 5 */
unsigned dictSize, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */
int lc, /* 0 <= lc <= 8, default = 3 */
int lp, /* 0 <= lp <= 4, default = 0 */
int pb, /* 0 <= pb <= 4, default = 2 */
int fb, /* 5 <= fb <= 273, default = 32 */
int numThreads /* 1 or 2, default = 2 */
)
{
CLzmaEncProps props;
LzmaEncProps_Init(&props);
props.level = level;
props.dictSize = dictSize;
props.lc = lc;
props.lp = lp;
props.pb = pb;
props.fb = fb;
props.numThreads = numThreads;
return LzmaEncode(dest, destLen, src, srcLen, &props, outProps, outPropsSize, 0,
NULL, &g_Alloc, &g_Alloc);
}
MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t *srcLen,
const unsigned char *props, size_t propsSize)
{
ELzmaStatus status;
return LzmaDecode(dest, destLen, src, srcLen, props, (unsigned)propsSize, LZMA_FINISH_ANY, &status, &g_Alloc);
}
/*** End of inlined file: LzmaLib.c ***/
#endif //LZMA_C_DEFINED
| 24.077188 | 150 | 0.648941 | [
"object",
"3d"
] |
d02f901a05c2e3e2d3e920712388d186add03b4a | 5,285 | cpp | C++ | examples_oldgl_glfw/105_MeshSlices/main.cpp | nobuyuki83/delfem2 | 118768431ccc5b77ed10b8f76f625d38e0b552f0 | [
"MIT"
] | 153 | 2018-08-16T21:51:33.000Z | 2022-03-28T10:34:48.000Z | examples_oldgl_glfw/105_MeshSlices/main.cpp | nobuyuki83/delfem2 | 118768431ccc5b77ed10b8f76f625d38e0b552f0 | [
"MIT"
] | 63 | 2018-08-16T21:53:34.000Z | 2022-02-22T13:50:34.000Z | examples_oldgl_glfw/105_MeshSlices/main.cpp | nobuyuki83/delfem2 | 118768431ccc5b77ed10b8f76f625d38e0b552f0 | [
"MIT"
] | 18 | 2018-12-17T05:39:15.000Z | 2021-11-16T08:21:16.000Z | /*
* Copyright (c) 2019 Nobuyuki Umetani
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <vector>
#include <string>
#include <cassert>
#include <cstdlib>
#include <set>
#include <filesystem>
#if defined(_WIN32) // windows
# define NOMINMAX // to remove min,max macro
# include <windows.h> // this should come before glfw3.h
#endif
#define GL_SILENCE_DEPRECATION
#include <GLFW/glfw3.h>
#include "delfem2/glfw/viewer3.h"
#include "delfem2/glfw/util.h"
#include "delfem2/opengl/old/funcs.h"
#include "delfem2/opengl/old/mshuni.h"
#include "delfem2/points.h"
#include "delfem2/msh_io_ply.h"
#include "delfem2/mshuni.h"
#include "delfem2/vec3.h"
#include "delfem2/slice.h"
namespace dfm2 = delfem2;
// ---------------------------
void myGlutDisplay(
const std::vector<double> &aXYZ,
const std::vector<unsigned int> &aTri,
const std::vector<delfem2::CSliceTriMesh> &aCS,
const std::vector<std::set<unsigned int> > &ReebGraphCS,
const std::vector<dfm2::CVec3d> &aCG_CS ) {
::glEnable(GL_LIGHTING);
delfem2::opengl::DrawMeshTri3D_FaceNorm(aXYZ, aTri);
::glDisable(GL_LIGHTING);
::glColor3d(1, 0, 0);
::glLineWidth(5);
for (auto &cs : aCS) {
::glBegin(GL_LINE_LOOP);
for (const auto &seg : cs.aTriInfo) {
double pA[3], pB[3];
seg.Pos3D(pA, pB,
aXYZ, aTri);
::glVertex3d(pA[0], pA[1], pA[2]);
}
::glEnd();
}
::glDisable(GL_DEPTH_TEST);
for (size_t ics = 0; ics < ReebGraphCS.size(); ++ics) {
::glColor3d(0, 0, 0);
::glPointSize(10);
::glBegin(GL_POINTS);
::glVertex3d(aCG_CS[ics].x, aCG_CS[ics].y, aCG_CS[ics].z);
::glEnd();
}
for (size_t ics = 0; ics < ReebGraphCS.size(); ++ics) {
for (auto itr = ReebGraphCS[ics].begin(); itr != ReebGraphCS[ics].end(); ++itr) {
const unsigned int jcs = *itr;
assert(jcs < aCS.size());
assert(abs(aCS[ics].IndHeight() - aCS[jcs].IndHeight()) == 1);
::glColor3d(0, 0, 0);
::glLineWidth(3);
::glBegin(GL_LINES);
::glVertex3d(aCG_CS[ics].x, aCG_CS[ics].y, aCG_CS[ics].z);
::glVertex3d(aCG_CS[jcs].x, aCG_CS[jcs].y, aCG_CS[jcs].z);
::glEnd();
}
}
::glEnable(GL_DEPTH_TEST);
}
void Hoge(
std::vector<double> &vtx_xyz,
std::vector<unsigned int> &tri_adjtri,
std::vector<delfem2::CSliceTriMesh> &aCS,
std::vector<std::set<unsigned int> > &ReebGraphCS,
std::vector<dfm2::CVec3d> &aCG_CS) {
delfem2::Read_Ply(
vtx_xyz, tri_adjtri,
std::filesystem::path(PATH_INPUT_DIR) / "bunny_1k.ply");
delfem2::Normalize_Points3(vtx_xyz);
std::vector<unsigned int> aTriSuTri;
ElSuEl_MeshElem(
aTriSuTri,
tri_adjtri.data(), tri_adjtri.size() / 3, delfem2::MESHELEM_TRI,
vtx_xyz.size() / 3);
std::vector<double> aHeight;
aHeight.push_back(-0.3);
aHeight.push_back(-0.2);
aHeight.push_back(-0.1);
aHeight.push_back(-0.0);
aHeight.push_back(+0.1);
aHeight.push_back(+0.2);
aHeight.push_back(+0.3);
const double nrm[3] = {0, 1, 0};
const double org[3] = {0, 0, 0};
{
std::vector<double> aHeightVtx(vtx_xyz.size() / 3);
for (size_t ip = 0; ip < vtx_xyz.size() / 3; ++ip) {
double x0 = vtx_xyz[ip * 3 + 0] - org[0];
double y0 = vtx_xyz[ip * 3 + 1] - org[1];
double z0 = vtx_xyz[ip * 3 + 2] - org[2];
aHeightVtx[ip] = nrm[0] * x0 + nrm[1] * y0 + nrm[2] * z0;
}
Slice_MeshTri3D_Heights(aCS,
aHeight,
aHeightVtx,
tri_adjtri, aTriSuTri);
}
MakeReebGraph(ReebGraphCS,
aCS, tri_adjtri, aTriSuTri);
assert(aCS.size() == ReebGraphCS.size());
aCG_CS.resize(aCS.size());
for (size_t ics = 0; ics < aCS.size(); ++ics) {
const double h0 = aHeight[aCS[ics].IndHeight()];
const double po[3] = {org[0] + nrm[0] * h0, org[1] + nrm[1] * h0, org[2] + nrm[2] * h0};
double sum_area = 0.0;
dfm2::CVec3d cg(0, 0, 0);
for (auto &iseg : aCS[ics].aTriInfo) {
double pA[3], pB[3];
iseg.Pos3D(pA, pB,
vtx_xyz, tri_adjtri);
double n0[3];
dfm2::NormalTri3(n0,
pA, pB, po);
const double area0 = n0[0] * nrm[0] + n0[1] * nrm[1] + n0[2] * nrm[2];
sum_area += area0;
cg.p[0] += area0 * (po[0] + pA[0] + pB[0]) / 3.0;
cg.p[1] += area0 * (po[1] + pA[1] + pB[1]) / 3.0;
cg.p[2] += area0 * (po[2] + pA[2] + pB[2]) / 3.0;
}
cg /= sum_area;
aCG_CS[ics] = cg;
}
}
int main() {
std::vector<double> vtx_xyz;
std::vector<unsigned int> tri_vtx;
std::vector<delfem2::CSliceTriMesh> aCS;
std::vector<std::set<unsigned int> > ReebGraphCS;
std::vector<dfm2::CVec3d> aCG_CS;
//
delfem2::glfw::CViewer3 viewer(0.5);
delfem2::glfw::InitGLOld();
viewer.InitGL();
delfem2::opengl::setSomeLighting();
Hoge(
vtx_xyz, tri_vtx,
aCS, ReebGraphCS, aCG_CS );
while (!glfwWindowShouldClose(viewer.window)) {
viewer.DrawBegin_oldGL();
myGlutDisplay(
vtx_xyz, tri_vtx,
aCS, ReebGraphCS, aCG_CS );
glfwSwapBuffers(viewer.window);
glfwPollEvents();
}
glfwDestroyWindow(viewer.window);
glfwTerminate();
exit(EXIT_SUCCESS);
}
| 29.361111 | 92 | 0.596973 | [
"vector"
] |
d032190ef49d3a535c1927829089b72ed05a4f79 | 1,788 | cc | C++ | test/ast_reader/test_ast_reader_libtooling.cc | onah/ciana | 9edce752bae39618adb3a9192ed2499ce6d61a81 | [
"MIT"
] | null | null | null | test/ast_reader/test_ast_reader_libtooling.cc | onah/ciana | 9edce752bae39618adb3a9192ed2499ce6d61a81 | [
"MIT"
] | null | null | null | test/ast_reader/test_ast_reader_libtooling.cc | onah/ciana | 9edce752bae39618adb3a9192ed2499ce6d61a81 | [
"MIT"
] | null | null | null | #include "ast_reader_libtooling.h"
#include "location.h"
#include <gtest/gtest.h>
#include <fstream>
#include <iostream>
#include <vector>
class ASTReaderLibToolingTest : public ::testing::Test {
protected:
virtual void SetUp() {
const std::string FileName = ".cianarc";
std::ofstream File;
File.open(FileName, std::ios::out);
File << "../../../test/ciana_test/c_valiable_function/build/"
"compile_commands.json"
<< std::endl;
}
};
TEST_F(ASTReaderLibToolingTest, getUsedLocationsNormal) {
Ciana::ASTReaderLibTooling AstReader;
ASSERT_NO_FATAL_FAILURE(ASSERT_TRUE(AstReader.initialize() == true));
Ciana::Location Input(
"../../../test/ciana_test/c_valiable_function/src/multi.c", 10, 17);
std::vector<Ciana::Location> Outputs;
bool Result = AstReader.get_used_locations(Input, Outputs);
ASSERT_EQ(true, Result);
ASSERT_EQ(4, Outputs.size());
// TODO; do test for filename
ASSERT_EQ(8, Outputs[0].get_line());
ASSERT_EQ(5, Outputs[0].get_column());
ASSERT_EQ(8, Outputs[1].get_line());
ASSERT_EQ(20, Outputs[1].get_column());
ASSERT_EQ(10, Outputs[2].get_line());
ASSERT_EQ(17, Outputs[2].get_column());
ASSERT_EQ(11, Outputs[3].get_line());
ASSERT_EQ(10, Outputs[3].get_column());
return;
}
/*
TEST_F(ASTReaderLibToolingTest, get) {
Ciana::Location Input(
"../../../test/ciana_test/c_valiable_function/src/multi.c", 10, 17);
std::vector<Ciana::Location> Outputs;
bool Result = AstReader.getImpactVariable(Input, Outputs);
ASSERT_EQ(true, Result);
ASSERT_EQ(1, Outputs.size());
// TODO: ASSERT_EQ("../../../test/ciana_test/c_valiable_function/src/multi.c", Outputs.get_filename);
ASSERT_EQ(10, Outputs[0].get_line());
ASSERT_EQ(3, Outputs[0].get_column());
}
*/
| 25.913043 | 103 | 0.685682 | [
"vector"
] |
d037b83cb3d8c9d1dcfe18585989fc43064fbb83 | 10,244 | cpp | C++ | optimal_control_casadi/UpAndDownBow.cpp | Carla-Ferreira/ViolinOptimalControl | 6a0d1e1880b845ce15b6d6b9412b60acb1a6f55f | [
"MIT"
] | 3 | 2019-07-02T13:37:14.000Z | 2022-03-31T17:29:31.000Z | optimal_control_casadi/UpAndDownBow.cpp | Carla-Ferreira/ViolinOptimalControl | 6a0d1e1880b845ce15b6d6b9412b60acb1a6f55f | [
"MIT"
] | 1 | 2020-04-16T02:21:49.000Z | 2020-04-16T02:21:49.000Z | optimal_control_casadi/UpAndDownBow.cpp | Carla-Ferreira/ViolinOptimalControl | 6a0d1e1880b845ce15b6d6b9412b60acb1a6f55f | [
"MIT"
] | 11 | 2019-04-23T15:14:07.000Z | 2021-04-02T15:05:49.000Z | // C++ (and CasADi) from here on
#include <casadi.hpp>
#include "utils.h"
#include "biorbdCasadi_interface_common.h"
#include "AnimationCallback.h"
#include "biorbd.h"
extern biorbd::Model m;
biorbd::Model m("../../models/BrasViolon.bioMod");
const std::string optimizationName("UpAndDowsBowCasadi");
const ViolinStringNames stringPlayed(ViolinStringNames::E);
static unsigned int idxSegmentBow(8);
static unsigned int idxSegmentViolin(16);
static unsigned int tagBowFrog(16);
static unsigned int tagBowTip(18);
static unsigned int tagViolinBStringBridge(42);
static unsigned int tagViolinEStringBridge(34);
static unsigned int tagViolinEStringNeck(35);
static unsigned int tagViolinAStringBridge(36);
static unsigned int tagViolinAStringNeck(37);
static unsigned int tagViolinDStringBridge(38);
static unsigned int tagViolinDStringNeck(39);
static unsigned int tagViolinGStringBridge(40);
static unsigned int tagViolinGStringNeck(41);
static unsigned int tagViolinCStringBridge(43);
static unsigned int idxCustomRTGString(0);
static unsigned int idxCustomRTDString(1);
static unsigned int idxCustomRTAString(2);
static unsigned int idxCustomRTEString(3);
// The following values for initialization were determined using the "find_initial_pose.py" script
const std::vector<double> initQFrogOnGString =
{-0.26963739, -0.37332812, 0.55297438, 1.16757958, 1.5453081, 0.08781926, 0.66038247, -0.58420915, -0.6424003};
const std::vector<double> initQTipOnGString =
{-0.01828739, -1.31128207, 0.19282409, 0.60925735, 0.70654631, -0.07557834, 0.17204947, 0.11369929, 0.26267182};
const std::vector<double> initQFrogOnDString =
{-0.12599098, -0.45205593, 0.5822579 , 1.11068584, 1.45957662, 0.11948427, 0.50336002, -0.40407875, -0.456703117};
const std::vector<double> initQTipOnDString =
{0.03788864, -0.70345511, 0.23451146, 0.9479002 , 0.11111476, 0.41349365, 0.24701369, 0.2606112 , 0.48426223};
const std::vector<double> initQFrogOnAString =
{-0.15691089, -0.52162508, 0.59001626, 1.10637291, 1.47285539, 0.03932967, 0.31431404, -0.39598565, -0.44465406};
const std::vector<double> initQTipOnAString =
{0.03051712, -0.69048243, 0.36951694, 0.88094724, 0.15574657, 0.29978535, 0.20718762, 0.14710871, 0.55469901};
const std::vector<double> initQFrogOnEString =
{-0.32244523, -0.45567388, 0.69477217, 1.14551489, 1.40942749, -0.10300415, 0.14266607, -0.23330034, -0.25421303};
const std::vector<double> initQTipOnEString =
{ 0.08773515, -0.56553214, 0.64993785, 1.0591878 , -0.18567152, 0.24296588, 0.15829188, 0.21021353, 0.71442364};
int main(int argc, char *argv[]){
// ---- OPTIONS ---- //
// Dimensions of the problem
std::cout << "Preparing the optimal control problem..." << std::endl;
Visualization visu(Visualization::LEVEL::GRAPH, argc, argv);
ProblemSize probSize;
probSize.tf = 0.5;
probSize.ns = 30;
probSize.dt = probSize.tf/probSize.ns; // length of a control interval
// Chose the ODE solver
ODE_SOLVER odeSolver(ODE_SOLVER::RK);
// Chose the objective functions
std::vector<std::pair<void (*)(const ProblemSize&,
const std::vector<casadi::MX>&,
const std::vector<casadi::MX>&,
double,
casadi::MX&), double>> objectiveFunctions;
objectiveFunctions.push_back(std::make_pair(minimizeTorqueControls, 100));
objectiveFunctions.push_back(std::make_pair(minimizeMuscleControls, 1));
objectiveFunctions.push_back(std::make_pair(minimizeStates, 1.0/10));
// Bounds and initial guess for the state
std::vector<biorbd::utils::Range> ranges;
for (unsigned int i=0; i<m.nbSegment(); ++i){
std::vector<biorbd::utils::Range> segRanges(m.segment(i).ranges());
for(unsigned int j=0; j<segRanges.size(); ++j){
ranges.push_back(segRanges[j]);
}
}
BoundaryConditions xBounds;
InitialConditions xInit;
std::vector<double> initQFrog;
std::vector<double> initQTip;
if (stringPlayed == ViolinStringNames::E){
initQFrog = initQFrogOnEString;
initQTip = initQTipOnEString;
}
else if (stringPlayed == ViolinStringNames::A){
initQFrog = initQFrogOnAString;
initQTip = initQTipOnAString;
}
else if (stringPlayed == ViolinStringNames::D){
initQFrog = initQFrogOnDString;
initQTip = initQTipOnDString;
}
else if (stringPlayed == ViolinStringNames::G){
initQFrog = initQFrogOnGString;
initQTip = initQTipOnGString;
}
biorbd::rigidbody::GeneralizedCoordinates initQ(m);
biorbd::rigidbody::GeneralizedVelocity initQdot(m);
biorbd::rigidbody::GeneralizedAcceleration initQddot(m);
for (unsigned int i=0; i<m.nbQ(); ++i){
initQ(i) = initQFrog[i];
initQdot(i) = 0;
initQddot(i) = 0;
}
Eigen::VectorXd initTau(m.nbGeneralizedTorque());
initTau.setZero(); // Inverse dynamics?
for (unsigned int i=0; i<m.nbQ(); ++i) {
xBounds.starting_min.push_back(ranges[i].min());
xBounds.min.push_back(ranges[i].min());
xBounds.end_min.push_back(ranges[i].min());
xBounds.starting_max.push_back(ranges[i].max());
xBounds.max.push_back(ranges[i].max());
xBounds.end_max.push_back(ranges[i].max());
xInit.val.push_back(initQFrog[i]);
};
for (unsigned int i=0; i<m.nbQdot(); ++i) {
xBounds.starting_min.push_back(0);
xBounds.min.push_back(-100);
xBounds.end_min.push_back(0);
xBounds.starting_max.push_back(0);
xBounds.max.push_back(100);
xBounds.end_max.push_back(0);
xInit.val.push_back(initTau(i));
};
// Bounds and initial guess for the control
BoundaryConditions uBounds;
InitialConditions uInit;
for (unsigned int i=0; i<m.nbMuscleTotal(); ++i) {
uBounds.min.push_back(0);
uBounds.max.push_back(1);
uInit.val.push_back(0.5);
};
for (unsigned int i=0; i<m.nbGeneralizedTorque(); ++i) {
uBounds.min.push_back(-100);
uBounds.max.push_back(100);
uInit.val.push_back(0);
};
// Prepare constraints
unsigned int stringBridgeIdx;
unsigned int stringNeckIdx;
unsigned int idxLowStringBound;
unsigned int idxHighStringBound;
unsigned int idxCustomRT;
if (stringPlayed == ViolinStringNames::E){
stringBridgeIdx = tagViolinEStringBridge;
stringNeckIdx = tagViolinEStringNeck;
idxLowStringBound = tagViolinAStringBridge;
idxHighStringBound = tagViolinBStringBridge;
idxCustomRT = idxCustomRTEString;
}
else if (stringPlayed == ViolinStringNames::A){
stringBridgeIdx = tagViolinAStringBridge;
stringNeckIdx = tagViolinAStringNeck;
idxLowStringBound = tagViolinDStringBridge;
idxHighStringBound = tagViolinEStringBridge;
idxCustomRT = idxCustomRTAString;
}
else if (stringPlayed == ViolinStringNames::D){
stringBridgeIdx = tagViolinDStringBridge;
stringNeckIdx = tagViolinDStringNeck;
idxLowStringBound = tagViolinGStringBridge;
idxHighStringBound = tagViolinAStringBridge;
idxCustomRT = idxCustomRTDString;
}
else if (stringPlayed == ViolinStringNames::G){
stringBridgeIdx = tagViolinGStringBridge;
stringNeckIdx = tagViolinGStringNeck;
idxLowStringBound = tagViolinCStringBridge;
idxHighStringBound = tagViolinDStringBridge;
idxCustomRT = idxCustomRTGString;
}
// If the movement is cyclic
bool useCyclicObjective = false;
bool useCyclicConstraint = false;
// Start at frog and get tip at end
std::vector<IndexPairing> markersToPair;
markersToPair.push_back(IndexPairing(Instant::START, {tagBowFrog, stringBridgeIdx}));
markersToPair.push_back(IndexPairing(Instant::MID, {tagBowTip, stringBridgeIdx}));
markersToPair.push_back(IndexPairing(Instant::END, {tagBowFrog, stringBridgeIdx}));
// Keep the string targetted by the bow
std::vector<IndexPairing> markerToProject;
markerToProject.push_back(
IndexPairing (Instant::ALL, {idxSegmentBow, stringBridgeIdx, PLANE::XZ}));
// Stay on one string and have a good direction of the bow
std::vector<IndexPairing> alignWithMarkersReferenceFrame;
// alignWithMarkersReferenceFrame.push_back(IndexPairing(Instant::ALL,
// {idxSegmentBow, AXIS::X, stringNeckIdx, stringBridgeIdx,
// AXIS::Y, idxLowStringBound, idxHighStringBound, AXIS::Y}));
// No need to aligning with markers
std::vector<IndexPairing> alignWithMarkers;
// No need to aligning two segments
std::vector<IndexPairing> axesToAlign;
// Always point toward a specific IMU
std::vector<IndexPairing> alignWithCustomRT;
alignWithCustomRT.push_back(IndexPairing(Instant::ALL, {idxSegmentBow, idxCustomRT}));
// From here, unless one wants to fundamentally change the problem,
// they should not change anything
casadi::MX V;
BoundaryConditions vBounds;
InitialConditions vInit;
std::vector<casadi::MX> g;
BoundaryConditions gBounds;
casadi::MX J;
casadi::Function dynamics;
prepareMusculoSkeletalNLP(probSize, odeSolver, uBounds, uInit, xBounds, xInit,
markersToPair, markerToProject, axesToAlign,
alignWithMarkers, alignWithMarkersReferenceFrame, alignWithCustomRT,
useCyclicObjective, useCyclicConstraint, objectiveFunctions,
V, vBounds, vInit, g, gBounds, J, dynamics);
// Optimize
AnimationCallback animCallback(visu, V, g, probSize, 10, dynamics);
clock_t start = clock();
std::vector<double> V_opt = solveProblemWithIpopt(V, vBounds, vInit, J, g, gBounds, probSize, animCallback);
clock_t end=clock();
// Get the optimal state trajectory
finalizeSolution(V_opt, probSize, optimizationName);
// ---------- FINALIZE ------------ //
double time_exec(double(end - start)/CLOCKS_PER_SEC);
// std::cout << "Execution time = " << time_exec<<std::endl;
while(animCallback.isActive()){}
return 0;
}
| 40.490119 | 118 | 0.687134 | [
"vector",
"model"
] |
d03f976f8e0a941225adabb805f7ba0257a3e6bc | 36,054 | cpp | C++ | Sources/Elastos/Frameworks/Droid/Base/Core/src/elastos/droid/widget/DatePickerCalendarDelegate.cpp | jingcao80/Elastos | d0f39852356bdaf3a1234743b86364493a0441bc | [
"Apache-2.0"
] | 7 | 2017-07-13T10:34:54.000Z | 2021-04-16T05:40:35.000Z | Sources/Elastos/Frameworks/Droid/Base/Core/src/elastos/droid/widget/DatePickerCalendarDelegate.cpp | jingcao80/Elastos | d0f39852356bdaf3a1234743b86364493a0441bc | [
"Apache-2.0"
] | null | null | null | Sources/Elastos/Frameworks/Droid/Base/Core/src/elastos/droid/widget/DatePickerCalendarDelegate.cpp | jingcao80/Elastos | d0f39852356bdaf3a1234743b86364493a0441bc | [
"Apache-2.0"
] | 9 | 2017-07-13T12:33:20.000Z | 2021-06-19T02:46:48.000Z | //=========================================================================
// Copyright (C) 2012 The Elastos Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//=========================================================================
#include <Elastos.CoreLibrary.Libcore.h>
#include "elastos/droid/widget/DatePickerCalendarDelegate.h"
#include "elastos/droid/widget/CDatePickerCalendarDelegateSavedState.h"
#include "elastos/droid/widget/CDayPickerView.h"
#include "elastos/droid/widget/CYearPickerView.h"
#include "elastos/droid/content/res/CColorStateList.h"
#include "elastos/droid/content/res/CConfiguration.h"
#include "elastos/droid/text/format/CDateFormat.h"
#include "elastos/droid/text/format/CDateUtils.h"
#include "elastos/droid/view/animation/CAlphaAnimation.h"
#include "elastos/droid/R.h"
#include <elastos/core/CoreUtils.h>
#include <elastos/core/StringUtils.h>
using Elastos::Droid::Content::Res::CColorStateList;
using Elastos::Droid::Content::Res::CConfiguration;
using Elastos::Droid::Text::Format::CDateFormat;
using Elastos::Droid::Text::Format::IDateUtils;
using Elastos::Droid::Text::Format::CDateUtils;
using Elastos::Droid::View::ILayoutInflater;
using Elastos::Droid::View::IViewGroup;
using Elastos::Droid::View::IHapticFeedbackConstants;
using Elastos::Droid::View::EIID_IViewOnClickListener;
using Elastos::Droid::View::Animation::CAlphaAnimation;
using Elastos::Droid::View::Accessibility::IAccessibilityRecord;
using Elastos::Droid::Widget::CDayPickerView;
using Elastos::Droid::Widget::CYearPickerView;
using Elastos::Droid::R;
using Elastos::Core::CoreUtils;
using Elastos::Core::StringUtils;
using Elastos::Text::CSimpleDateFormat;
using Elastos::Text::IFormat;
using Elastos::Utility::ICalendarHelper;
using Elastos::Utility::CCalendarHelper;
using Elastos::Utility::ILocaleHelper;
using Elastos::Utility::CLocaleHelper;
using Elastos::Utility::CHashSet;
using Elastos::Utility::IIterator;
namespace Elastos {
namespace Droid {
namespace Widget {
// ==================================================================
// DatePickerCalendarDelegate::InnerListener
// ==================================================================
CAR_INTERFACE_IMPL(DatePickerCalendarDelegate::InnerListener, Object, IViewOnClickListener)
DatePickerCalendarDelegate::InnerListener::InnerListener(
/* [in] */ DatePickerCalendarDelegate* host)
: mHost(host)
{}
ECode DatePickerCalendarDelegate::InnerListener::OnClick(
/* [in] */ IView* v)
{
return mHost->OnClick(v);
}
// ==================================================================
// DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::
// ==================================================================
CAR_INTERFACE_IMPL(DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState,
View::BaseSavedState, IDatePickerCalendarDelegateSavedState)
DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::DatePickerCalendarDelegateSavedState()
: mSelectedYear(0)
, mSelectedMonth(0)
, mSelectedDay(0)
, mMinDate(0)
, mMaxDate(0)
, mCurrentView(0)
, mListPosition(0)
, mListPositionOffset(0)
{}
DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::~DatePickerCalendarDelegateSavedState()
{}
ECode DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::constructor(
/* [in] */ IParcelable* superState,
/* [in] */ Int32 year,
/* [in] */ Int32 month,
/* [in] */ Int32 day,
/* [in] */ Int64 minDate,
/* [in] */ Int64 maxDate,
/* [in] */ Int32 currentView,
/* [in] */ Int32 listPosition,
/* [in] */ Int32 listPositionOffset)
{
Elastos::Droid::View::View::BaseSavedState::constructor(superState);
mSelectedYear = year;
mSelectedMonth = month;
mSelectedDay = day;
mMinDate = minDate;
mMaxDate = maxDate;
mCurrentView = currentView;
mListPosition = listPosition;
mListPositionOffset = listPositionOffset;
return NOERROR;
}
ECode DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::constructor()
{
return Elastos::Droid::View::View::BaseSavedState::constructor();
}
ECode DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::ReadFromParcel(
/* [in] */ IParcel* source)
{
Elastos::Droid::View::View::BaseSavedState::ReadFromParcel(source);
source->ReadInt32(&mSelectedYear);
source->ReadInt32(&mSelectedMonth);
source->ReadInt32(&mSelectedDay);
source->ReadInt64(&mMinDate);
source->ReadInt64(&mMaxDate);
source->ReadInt32(&mCurrentView);
source->ReadInt32(&mListPosition);
source->ReadInt32(&mListPositionOffset);
return NOERROR;
}
ECode DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::WriteToParcel(
/* [in] */ IParcel* dest)
{
Elastos::Droid::View::View::BaseSavedState::WriteToParcel(dest);
dest->WriteInt32(mSelectedYear);
dest->WriteInt32(mSelectedMonth);
dest->WriteInt32(mSelectedDay);
dest->WriteInt64(mMinDate);
dest->WriteInt64(mMaxDate);
dest->WriteInt32(mCurrentView);
dest->WriteInt32(mListPosition);
dest->WriteInt32(mListPositionOffset);
return NOERROR;
}
Int32 DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::GetSelectedDay()
{
return mSelectedDay;
}
Int32 DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::GetSelectedMonth()
{
return mSelectedMonth;
}
Int32 DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::GetSelectedYear()
{
return mSelectedYear;
}
Int64 DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::GetMinDate()
{
return mMinDate;
}
Int64 DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::GetMaxDate()
{
return mMaxDate;
}
Int32 DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::GetCurrentView()
{
return mCurrentView;
}
Int32 DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::GetListPosition()
{
return mListPosition;
}
Int32 DatePickerCalendarDelegate::DatePickerCalendarDelegateSavedState::GetListPositionOffset()
{
return mListPositionOffset;
}
// ==================================================================
// DatePickerCalendarDelegate::
// ==================================================================
const Int32 DatePickerCalendarDelegate::USE_LOCALE = 0;
const Int32 DatePickerCalendarDelegate::UNINITIALIZED = -1;
const Int32 DatePickerCalendarDelegate::MONTH_AND_DAY_VIEW = 0;
const Int32 DatePickerCalendarDelegate::YEAR_VIEW = 1;
const Int32 DatePickerCalendarDelegate::DEFAULT_START_YEAR = 1900;
const Int32 DatePickerCalendarDelegate::DEFAULT_END_YEAR = 2100;
const Int32 DatePickerCalendarDelegate::ANIMATION_DURATION = 300;
const Int32 DatePickerCalendarDelegate::MONTH_INDEX = 0;
const Int32 DatePickerCalendarDelegate::DAY_INDEX = 1;
const Int32 DatePickerCalendarDelegate::YEAR_INDEX = 2;
CAR_INTERFACE_IMPL_2(DatePickerCalendarDelegate, DatePicker::AbstractDatePickerDelegate,
IDatePickerCalendarDelegate, IDatePickerController)
DatePickerCalendarDelegate::DatePickerCalendarDelegate()
: mIsEnabled(TRUE)
, mCurrentView(UNINITIALIZED)
, mFirstDayOfWeek(USE_LOCALE)
{
AutoPtr<ILocaleHelper> hlp;
CLocaleHelper::AcquireSingleton((ILocaleHelper**)&hlp);
AutoPtr<ILocale> locale;
hlp->GetDefault((ILocale**)&locale);
CSimpleDateFormat::New(String("y"), locale, (ISimpleDateFormat**)&mYearFormat);
CSimpleDateFormat::New(String("d"), locale, (ISimpleDateFormat**)&mDayFormat);
CHashSet::New((IHashSet**)&mListeners);
}
DatePickerCalendarDelegate::~DatePickerCalendarDelegate()
{}
ECode DatePickerCalendarDelegate::constructor(
/* [in] */ IDatePicker* delegator,
/* [in] */ IContext* context,
/* [in] */ IAttributeSet* attrs,
/* [in] */ Int32 defStyleAttr,
/* [in] */ Int32 defStyleRes)
{
DatePicker::AbstractDatePickerDelegate::constructor(delegator, context);
AutoPtr<InnerListener> listener = new InnerListener(this);
AutoPtr<ILocaleHelper> hlp;
CLocaleHelper::AcquireSingleton((ILocaleHelper**)&hlp);
AutoPtr<ILocale> locale;
hlp->GetDefault((ILocale**)&locale);
mMinDate = GetCalendarForLocale(mMinDate, locale);
mMaxDate = GetCalendarForLocale(mMaxDate, locale);
mTempDate = GetCalendarForLocale(mMaxDate, locale);
mCurrentDate = GetCalendarForLocale(mCurrentDate, locale);
mMinDate->Set(DEFAULT_START_YEAR, ICalendar::JANUARY, 1);
mMaxDate->Set(DEFAULT_END_YEAR, ICalendar::DECEMBER, 31);
AutoPtr<IResources> res;
IView::Probe(mDelegator)->GetResources((IResources**)&res);
AutoPtr<ArrayOf<Int32> > attrIds = TO_ATTRS_ARRAYOF(R::styleable::DatePicker);
AutoPtr<ITypedArray> a;
mContext->ObtainStyledAttributes(attrs,
attrIds, defStyleAttr, defStyleRes, (ITypedArray**)&a);
AutoPtr<IInterface> pInf;
mContext->GetSystemService(
IContext::LAYOUT_INFLATER_SERVICE, (IInterface**)&pInf);
AutoPtr<ILayoutInflater> inflater = ILayoutInflater::Probe(pInf);
Int32 layoutResourceId = 0;
a->GetResourceId(
R::styleable::DatePicker_internalLayout, R::layout::date_picker_holo, &layoutResourceId);
AutoPtr<IView> mainView;
inflater->Inflate(layoutResourceId, NULL, (IView**)&mainView);
IViewGroup::Probe(mDelegator)->AddView(mainView);
AutoPtr<IView> dwView;
mainView->FindViewById(R::id::date_picker_header, (IView**)&dwView);
mDayOfWeekView = ITextView::Probe(dwView);
// Layout that contains the current date and day name header.
AutoPtr<IView> v;
mainView->FindViewById(
R::id::day_picker_selector_layout, (IView**)&v);
AutoPtr<ILinearLayout> dateLayout = ILinearLayout::Probe(v);
v = NULL;
mainView->FindViewById(
R::id::date_picker_month_day_year_layout, (IView**)&v);
mMonthDayYearLayout = ILinearLayout::Probe(v);
v = NULL;
mainView->FindViewById(
R::id::date_picker_month_and_day_layout, (IView**)&v);
mMonthAndDayLayout = ILinearLayout::Probe(v);
v->SetOnClickListener(listener);
v = NULL;
mainView->FindViewById(R::id::date_picker_month, (IView**)&v);
mHeaderMonthTextView = ITextView::Probe(v);
v = NULL;
mainView->FindViewById(R::id::date_picker_day, (IView**)&v);
mHeaderDayOfMonthTextView = ITextView::Probe(v);
v = NULL;
mainView->FindViewById(R::id::date_picker_year, (IView**)&v);
mHeaderYearTextView = ITextView::Probe(v);
v->SetOnClickListener(listener);
// Obtain default highlight color from the theme.
Int32 defaultHighlightColor = 0;
mHeaderYearTextView->GetHighlightColor(&defaultHighlightColor);
// Use Theme attributes if possible
Int32 dayOfWeekTextAppearanceResId = 0;
a->GetResourceId(
R::styleable::DatePicker_dayOfWeekTextAppearance, -1, &dayOfWeekTextAppearanceResId);
if (dayOfWeekTextAppearanceResId != -1) {
mDayOfWeekView->SetTextAppearance(context, dayOfWeekTextAppearanceResId);
}
AutoPtr<IDrawable> d;
a->GetDrawable(R::styleable::DatePicker_dayOfWeekBackground, (IDrawable**)&d);
IView::Probe(mDayOfWeekView)->SetBackground(d);
d = NULL;
a->GetDrawable(R::styleable::DatePicker_headerBackground, (IDrawable**)&d);
IView::Probe(dateLayout)->SetBackground(d);
Int32 headerSelectedTextColor = 0;
a->GetColor(
R::styleable::DatePicker_headerSelectedTextColor, defaultHighlightColor, &headerSelectedTextColor);
Int32 monthTextAppearanceResId = 0;
a->GetResourceId(
R::styleable::DatePicker_headerMonthTextAppearance, -1, &monthTextAppearanceResId);
if (monthTextAppearanceResId != -1) {
mHeaderMonthTextView->SetTextAppearance(context, monthTextAppearanceResId);
}
AutoPtr<IColorStateList> cl;
mHeaderMonthTextView->GetTextColors((IColorStateList**)&cl);
mHeaderMonthTextView->SetTextColor(CColorStateList::AddFirstIfMissing(
cl, R::attr::state_selected, headerSelectedTextColor));
Int32 dayOfMonthTextAppearanceResId = 0;
a->GetResourceId(
R::styleable::DatePicker_headerDayOfMonthTextAppearance, -1, &dayOfMonthTextAppearanceResId);
if (dayOfMonthTextAppearanceResId != -1) {
mHeaderDayOfMonthTextView->SetTextAppearance(context, dayOfMonthTextAppearanceResId);
}
cl = NULL;
mHeaderDayOfMonthTextView->GetTextColors((IColorStateList**)&cl);
mHeaderDayOfMonthTextView->SetTextColor(CColorStateList::AddFirstIfMissing(
cl, R::attr::state_selected, headerSelectedTextColor));
Int32 yearTextAppearanceResId = 0;
a->GetResourceId(
R::styleable::DatePicker_headerYearTextAppearance, -1, &yearTextAppearanceResId);
if (yearTextAppearanceResId != -1) {
mHeaderYearTextView->SetTextAppearance(context, yearTextAppearanceResId);
}
cl = NULL;
mHeaderYearTextView->GetTextColors((IColorStateList**)&cl);
mHeaderYearTextView->SetTextColor(CColorStateList::AddFirstIfMissing(
cl, R::attr::state_selected, headerSelectedTextColor));
CDayPickerView::New(mContext, this, (IDayPickerView**)&mDayPickerView);
CYearPickerView::New(mContext, (IYearPickerView**)&mYearPickerView);
mYearPickerView->Init(this);
Int32 yearSelectedCircleColor = 0;
a->GetColor(R::styleable::DatePicker_yearListSelectorColor,
defaultHighlightColor, &yearSelectedCircleColor);
mYearPickerView->SetYearSelectedCircleColor(yearSelectedCircleColor);
AutoPtr<IColorStateList> calendarTextColor;
a->GetColorStateList(
R::styleable::DatePicker_calendarTextColor, (IColorStateList**)&calendarTextColor);
Int32 calendarSelectedTextColor = 0;
a->GetColor(
R::styleable::DatePicker_calendarSelectedTextColor, defaultHighlightColor, &calendarSelectedTextColor);
((CDayPickerView*)mDayPickerView.Get())->SetCalendarTextColor(CColorStateList::AddFirstIfMissing(
calendarTextColor, R::attr::state_selected, calendarSelectedTextColor));
res->GetString(R::string::day_picker_description, &mDayPickerDescription);
res->GetString(R::string::select_day, &mSelectDay);
res->GetString(R::string::year_picker_description, &mYearPickerDescription);
res->GetString(R::string::select_year, &mSelectYear);
v = NULL;
mainView->FindViewById(R::id::animator, (IView**)&v);
mAnimator = IAccessibleDateAnimator::Probe(v);
IViewGroup::Probe(mAnimator)->AddView(IView::Probe(mDayPickerView));
IViewGroup::Probe(mAnimator)->AddView(IView::Probe(mYearPickerView));
Int64 mils = 0;
mCurrentDate->GetTimeInMillis(&mils);
mAnimator->SetDateMillis(mils);
AutoPtr<IAnimation> animation;
CAlphaAnimation::New(0.0f, 1.0f, (IAnimation**)&animation);
animation->SetDuration(ANIMATION_DURATION);
IViewAnimator::Probe(mAnimator)->SetInAnimation(animation);
AutoPtr<IAnimation> animation2;
CAlphaAnimation::New(1.0f, 0.0f, (IAnimation**)&animation2);
animation2->SetDuration(ANIMATION_DURATION);
IViewAnimator::Probe(mAnimator)->SetOutAnimation(animation2);
UpdateDisplay(FALSE);
SetCurrentView(MONTH_AND_DAY_VIEW);
return NOERROR;
}
AutoPtr<ICalendar> DatePickerCalendarDelegate::GetCalendarForLocale(
/* [in] */ ICalendar* oldCalendar,
/* [in] */ ILocale* locale)
{
AutoPtr<ICalendarHelper> hlp;
CCalendarHelper::AcquireSingleton((ICalendarHelper**)&hlp);
if (oldCalendar == NULL) {
AutoPtr<ICalendar> c;
hlp->GetInstance(locale, (ICalendar**)&c);
return c;
}
else {
Int64 currentTimeMillis = 0;
oldCalendar->GetTimeInMillis(¤tTimeMillis);
AutoPtr<ICalendar> newCalendar;
hlp->GetInstance(locale, (ICalendar**)&newCalendar);
newCalendar->SetTimeInMillis(currentTimeMillis);
return newCalendar;
}
}
AutoPtr<ArrayOf<Int32> > DatePickerCalendarDelegate::GetMonthDayYearIndexes(
/* [in] */ const String& pattern)
{
AutoPtr<ArrayOf<Int32> > result = ArrayOf<Int32>::Alloc(3);
String filteredPattern;
StringUtils::ReplaceAll(pattern, "'.*?'", "", &filteredPattern);
Int32 dayIndex = filteredPattern.IndexOf('d');
Int32 monthMIndex = filteredPattern.IndexOf("M");
Int32 monthIndex = (monthMIndex != -1) ? monthMIndex : filteredPattern.IndexOf("L");
Int32 yearIndex = filteredPattern.IndexOf("y");
if (yearIndex < monthIndex) {
(*result)[YEAR_INDEX] = 0;
if (monthIndex < dayIndex) {
(*result)[MONTH_INDEX] = 1;
(*result)[DAY_INDEX] = 2;
}
else {
(*result)[MONTH_INDEX] = 2;
(*result)[DAY_INDEX] = 1;
}
}
else {
(*result)[YEAR_INDEX] = 2;
if (monthIndex < dayIndex) {
(*result)[MONTH_INDEX] = 0;
(*result)[DAY_INDEX] = 1;
}
else {
(*result)[MONTH_INDEX] = 1;
(*result)[DAY_INDEX] = 0;
}
}
return result;
}
void DatePickerCalendarDelegate::UpdateDisplay(
/* [in] */ Boolean announce)
{
AutoPtr<ILocaleHelper> hlp;
CLocaleHelper::AcquireSingleton((ILocaleHelper**)&hlp);
AutoPtr<ILocale> locale;
hlp->GetDefault((ILocale**)&locale);
if (mDayOfWeekView != NULL) {
String str;
mCurrentDate->GetDisplayName(ICalendar::DAY_OF_WEEK, ICalendar::LONG,
locale, &str);
mDayOfWeekView->SetText(CoreUtils::Convert(str));
}
// Compute indices of Month, Day and Year views
using Elastos::Droid::Text::Format::IDateFormat;
AutoPtr<IDateFormat> df;
CDateFormat::AcquireSingleton((IDateFormat**)&df);
String bestDateTimePattern;
df->GetBestDateTimePattern(mCurrentLocale, String("yMMMd"), &bestDateTimePattern);
AutoPtr<ArrayOf<Int32> > viewIndices = GetMonthDayYearIndexes(bestDateTimePattern);
// Position the Year and MonthAndDay views within the header.
IViewGroup* mdyl = IViewGroup::Probe(mMonthDayYearLayout);
mdyl->RemoveAllViews();
if ((*viewIndices)[YEAR_INDEX] == 0) {
mdyl->AddView(IView::Probe(mHeaderYearTextView));
mdyl->AddView(IView::Probe(mMonthAndDayLayout));
}
else {
mdyl->AddView(IView::Probe(mMonthAndDayLayout));
mdyl->AddView(IView::Probe(mHeaderYearTextView));
}
// Position Day and Month views within the MonthAndDay view.
IViewGroup* madl = IViewGroup::Probe(mMonthAndDayLayout);
madl->RemoveAllViews();
if ((*viewIndices)[MONTH_INDEX] > (*viewIndices)[DAY_INDEX]) {
madl->AddView(IView::Probe(mHeaderDayOfMonthTextView));
madl->AddView(IView::Probe(mHeaderMonthTextView));
}
else {
madl->AddView(IView::Probe(mHeaderMonthTextView));
madl->AddView(IView::Probe(mHeaderDayOfMonthTextView));
}
String dn;
mCurrentDate->GetDisplayName(ICalendar::MONTH, ICalendar::SHORT, locale, &dn);
String dnup = dn.ToUpperCase(/*locale*/);
mHeaderMonthTextView->SetText(CoreUtils::Convert(dnup));
AutoPtr<IDate> dt;
mCurrentDate->GetTime((IDate**)&dt);
String dayF, yearF;
Elastos::Text::IDateFormat::Probe(mDayFormat)->Format(dt, &dayF);
Elastos::Text::IDateFormat::Probe(mYearFormat)->Format(dt, &yearF);
mHeaderDayOfMonthTextView->SetText(CoreUtils::Convert(dayF));
mHeaderYearTextView->SetText(CoreUtils::Convert(yearF));
// Accessibility.
Int64 millis = 0;
mCurrentDate->GetTimeInMillis(&millis);
mAnimator->SetDateMillis(millis);
Int32 flags = IDateUtils::FORMAT_SHOW_DATE | IDateUtils::FORMAT_NO_YEAR;
AutoPtr<IDateUtils> du;
CDateUtils::AcquireSingleton((IDateUtils**)&du);
String monthAndDayText;
du->FormatDateTime(mContext, millis, flags, &monthAndDayText);
IView::Probe(mMonthAndDayLayout)->SetContentDescription(CoreUtils::Convert(monthAndDayText));
if (announce) {
flags = IDateUtils::FORMAT_SHOW_DATE | IDateUtils::FORMAT_SHOW_YEAR;
String fullDateText;
du->FormatDateTime(mContext, millis, flags, &fullDateText);
IView::Probe(mAnimator)->AnnounceForAccessibility(CoreUtils::Convert(fullDateText));
}
UpdatePickers();
}
void DatePickerCalendarDelegate::SetCurrentView(
/* [in] */ Int32 viewIndex)
{
Int64 millis = 0;
mCurrentDate->GetTimeInMillis(&millis);
switch (viewIndex) {
case MONTH_AND_DAY_VIEW: {
CDayPickerView* dpv = (CDayPickerView*)mDayPickerView.Get();
dpv->OnDateChanged();
if (mCurrentView != viewIndex) {
IView::Probe(mMonthAndDayLayout)->SetSelected(TRUE);
IView::Probe(mHeaderYearTextView)->SetSelected(FALSE);
IViewAnimator::Probe(mAnimator)->SetDisplayedChild(MONTH_AND_DAY_VIEW);
mCurrentView = viewIndex;
}
Int32 flags = IDateUtils::FORMAT_SHOW_DATE;
AutoPtr<IDateUtils> du;
CDateUtils::AcquireSingleton((IDateUtils**)&du);
String dayString;
du->FormatDateTime(mContext, millis, flags, &dayString);
String dsp = mDayPickerDescription + ": " + dayString;
IView* animator = IView::Probe(mAnimator);
animator->SetContentDescription(CoreUtils::Convert(dsp));
animator->AnnounceForAccessibility(CoreUtils::Convert(mSelectDay));
break;
}
case YEAR_VIEW: {
CDayPickerView* dpv = (CDayPickerView*)mDayPickerView.Get();
dpv->OnDateChanged();
if (mCurrentView != viewIndex) {
IView::Probe(mMonthAndDayLayout)->SetSelected(FALSE);
IView::Probe(mHeaderYearTextView)->SetSelected(TRUE);
IViewAnimator::Probe(mAnimator)->SetDisplayedChild(YEAR_VIEW);
mCurrentView = viewIndex;
}
String yearString;
IFormat::Probe(mYearFormat)->Format(CoreUtils::Convert(millis), &yearString);
String yDSP = mYearPickerDescription + ": " + yearString;
IView* animator = IView::Probe(mAnimator);
animator->SetContentDescription(CoreUtils::Convert(yDSP));
animator->AnnounceForAccessibility(CoreUtils::Convert(mSelectYear));
break;
}
}
}
ECode DatePickerCalendarDelegate::Init(
/* [in] */ Int32 year,
/* [in] */ Int32 monthOfYear,
/* [in] */ Int32 dayOfMonth,
/* [in] */ IDatePickerOnDateChangedListener* callBack)
{
mDateChangedListener = callBack;
mCurrentDate->Set(ICalendar::YEAR, year);
mCurrentDate->Set(ICalendar::MONTH, monthOfYear);
mCurrentDate->Set(ICalendar::DAY_OF_MONTH, dayOfMonth);
UpdateDisplay(FALSE);
return NOERROR;
}
ECode DatePickerCalendarDelegate::UpdateDate(
/* [in] */ Int32 year,
/* [in] */ Int32 month,
/* [in] */ Int32 dayOfMonth)
{
mCurrentDate->Set(ICalendar::YEAR, year);
mCurrentDate->Set(ICalendar::MONTH, month);
mCurrentDate->Set(ICalendar::DAY_OF_MONTH, dayOfMonth);
if (mDateChangedListener != NULL) {
mDateChangedListener->OnDateChanged(mDelegator, year, month, dayOfMonth);
}
UpdateDisplay(FALSE);
return NOERROR;
}
ECode DatePickerCalendarDelegate::GetYear(
/* [out] */ Int32* year)
{
VALIDATE_NOT_NULL(year)
return mCurrentDate->Get(ICalendar::YEAR, year);
}
ECode DatePickerCalendarDelegate::GetMonth(
/* [out] */ Int32* month)
{
VALIDATE_NOT_NULL(month)
return mCurrentDate->Get(ICalendar::MONTH, month);
}
ECode DatePickerCalendarDelegate::GetDayOfMonth(
/* [out] */ Int32* dayOfMonth)
{
VALIDATE_NOT_NULL(dayOfMonth)
return mCurrentDate->Get(ICalendar::DAY_OF_MONTH, dayOfMonth);
}
ECode DatePickerCalendarDelegate::SetMinDate(
/* [in] */ Int64 minDate)
{
mTempDate->SetTimeInMillis(minDate);
Int32 tmpY = 0, minY = 0, tmpD = 0, minD = 0;
mTempDate->Get(ICalendar::YEAR, &tmpY);
mMinDate->Get(ICalendar::YEAR, &minY);
mTempDate->Get(ICalendar::DAY_OF_YEAR, &tmpD);
mMinDate->Get(ICalendar::DAY_OF_YEAR, &minD);
if (tmpY == minY && tmpD != minD) {
return NOERROR;
}
Boolean bBf = FALSE;
if ((mCurrentDate->IsBefore(mTempDate, &bBf), bBf)) {
mCurrentDate->SetTimeInMillis(minDate);
UpdatePickers();
UpdateDisplay(FALSE);
}
mMinDate->SetTimeInMillis(minDate);
AutoPtr<ICalendar> cl;
GetSelectedDay((ICalendar**)&cl);
Boolean b = FALSE;
mDayPickerView->GoTo(cl, FALSE, TRUE, TRUE, &b);
return NOERROR;
}
ECode DatePickerCalendarDelegate::GetMinDate(
/* [out] */ ICalendar** calendar)
{
VALIDATE_NOT_NULL(calendar)
*calendar = mMinDate;
REFCOUNT_ADD(*calendar)
return NOERROR;
}
ECode DatePickerCalendarDelegate::SetMaxDate(
/* [in] */ Int64 maxDate)
{
mTempDate->SetTimeInMillis(maxDate);
Int32 tmpY = 0, maxY = 0, tmpD = 0, maxD = 0;
mTempDate->Get(ICalendar::YEAR, &tmpY);
mMaxDate->Get(ICalendar::YEAR, &maxY);
mTempDate->Get(ICalendar::DAY_OF_YEAR, &tmpD);
mMaxDate->Get(ICalendar::DAY_OF_YEAR, &maxD);
if (tmpY == maxY && tmpD != maxD) {
return NOERROR;
}
Boolean bAf = FALSE;
if ((mCurrentDate->IsAfter(mTempDate, &bAf), bAf)) {
mCurrentDate->SetTimeInMillis(maxDate);
UpdatePickers();
UpdateDisplay(FALSE);
}
mMaxDate->SetTimeInMillis(maxDate);
AutoPtr<ICalendar> cl;
GetSelectedDay((ICalendar**)&cl);
Boolean b = FALSE;
mDayPickerView->GoTo(cl, FALSE, TRUE, TRUE, &b);
return NOERROR;
}
ECode DatePickerCalendarDelegate::GetMaxDate(
/* [out] */ ICalendar** maxDate)
{
VALIDATE_NOT_NULL(maxDate)
*maxDate = mMaxDate;
REFCOUNT_ADD(*maxDate)
return NOERROR;
}
ECode DatePickerCalendarDelegate::SetFirstDayOfWeek(
/* [in] */ Int32 firstDayOfWeek)
{
mFirstDayOfWeek = firstDayOfWeek;
return NOERROR;
}
ECode DatePickerCalendarDelegate::GetFirstDayOfWeek(
/* [out] */ Int32* firstDayOfWeek)
{
VALIDATE_NOT_NULL(firstDayOfWeek)
if (mFirstDayOfWeek != USE_LOCALE) {
*firstDayOfWeek = mFirstDayOfWeek;
return NOERROR;
}
return mCurrentDate->GetFirstDayOfWeek(firstDayOfWeek);
}
ECode DatePickerCalendarDelegate::GetMinYear(
/* [out] */ Int32* minYear)
{
VALIDATE_NOT_NULL(minYear)
return mMinDate->Get(ICalendar::YEAR, minYear);
}
ECode DatePickerCalendarDelegate::GetMaxYear(
/* [out] */ Int32* maxYear)
{
VALIDATE_NOT_NULL(maxYear)
return mMaxDate->Get(ICalendar::YEAR, maxYear);
}
ECode DatePickerCalendarDelegate::GetMinMonth(
/* [out] */ Int32* minMonth)
{
VALIDATE_NOT_NULL(minMonth)
return mMinDate->Get(ICalendar::MONTH, minMonth);
}
ECode DatePickerCalendarDelegate::GetMaxMonth(
/* [out] */ Int32* maxMonth)
{
VALIDATE_NOT_NULL(maxMonth)
return mMaxDate->Get(ICalendar::MONTH, maxMonth);
}
ECode DatePickerCalendarDelegate::GetMinDay(
/* [out] */ Int32* minDay)
{
VALIDATE_NOT_NULL(minDay)
return mMinDate->Get(ICalendar::DAY_OF_MONTH, minDay);
}
ECode DatePickerCalendarDelegate::GetMaxDay(
/* [out] */ Int32* maxDay)
{
VALIDATE_NOT_NULL(maxDay)
return mMaxDate->Get(ICalendar::DAY_OF_MONTH, maxDay);
}
ECode DatePickerCalendarDelegate::SetEnabled(
/* [in] */ Boolean enabled)
{
IView::Probe(mMonthAndDayLayout)->SetEnabled(enabled);
IView::Probe(mHeaderYearTextView)->SetEnabled(enabled);
IView::Probe(mAnimator)->SetEnabled(enabled);
mIsEnabled = enabled;
return NOERROR;
}
ECode DatePickerCalendarDelegate::IsEnabled(
/* [out] */ Boolean* enabled)
{
VALIDATE_NOT_NULL(enabled)
*enabled = mIsEnabled;
return NOERROR;
}
ECode DatePickerCalendarDelegate::GetCalendarView(
/* [out] */ ICalendarView** view)
{
VALIDATE_NOT_NULL(view)
// throw new UnsupportedOperationException(
// "CalendarView does not exists for the new DatePicker");
return E_UNSUPPORTED_OPERATION_EXCEPTION;
}
ECode DatePickerCalendarDelegate::SetCalendarViewShown(
/* [in] */ Boolean shown)
{
// No-op for compatibility with the old DatePicker.
return NOERROR;
}
ECode DatePickerCalendarDelegate::GetCalendarViewShown(
/* [out] */ Boolean* shown)
{
VALIDATE_NOT_NULL(shown)
*shown = FALSE;
return NOERROR;
}
ECode DatePickerCalendarDelegate::SetSpinnersShown(
/* [in] */ Boolean shown)
{
// No-op for compatibility with the old DatePicker.
return NOERROR;
}
ECode DatePickerCalendarDelegate::GetSpinnersShown(
/* [out] */ Boolean* shown)
{
VALIDATE_NOT_NULL(shown)
*shown = FALSE;
return NOERROR;
}
ECode DatePickerCalendarDelegate::OnConfigurationChanged(
/* [in] */ IConfiguration* newConfig)
{
AutoPtr<CConfiguration> cfg = (CConfiguration*)newConfig;
mYearFormat = NULL;
mDayFormat = NULL;
CSimpleDateFormat::New(String("y"), cfg->mLocale, (ISimpleDateFormat**)&mYearFormat);
CSimpleDateFormat::New(String("d"), cfg->mLocale, (ISimpleDateFormat**)&mDayFormat);
return NOERROR;
}
ECode DatePickerCalendarDelegate::OnSaveInstanceState(
/* [in] */ IParcelable* superState,
/* [out] */ IParcelable** result)
{
VALIDATE_NOT_NULL(result)
Int32 year = 0;
mCurrentDate->Get(ICalendar::YEAR, &year);
Int32 month = 0;
mCurrentDate->Get(ICalendar::MONTH, &month);
Int32 day = 0;
mCurrentDate->Get(ICalendar::DAY_OF_MONTH, &day);
Int32 listPosition = -1;
Int32 listPositionOffset = -1;
if (mCurrentView == MONTH_AND_DAY_VIEW) {
mDayPickerView->GetMostVisiblePosition(&listPosition);
}
else if (mCurrentView == YEAR_VIEW) {
IAdapterView::Probe(mYearPickerView)->GetFirstVisiblePosition(&listPosition);
mYearPickerView->GetFirstPositionOffset(&listPositionOffset);
}
Int64 minMils = 0, maxMils = 0;
mMinDate->GetTimeInMillis(&minMils);
mMaxDate->GetTimeInMillis(&maxMils);
AutoPtr<IDatePickerCalendarDelegateSavedState> res;
CDatePickerCalendarDelegateSavedState::New(superState, year, month, day, minMils,
maxMils, mCurrentView, listPosition, listPositionOffset,
(IDatePickerCalendarDelegateSavedState**)&res);
*result = IParcelable::Probe(res);
REFCOUNT_ADD(*result)
return NOERROR;
}
ECode DatePickerCalendarDelegate::OnRestoreInstanceState(
/* [in] */ IParcelable* state)
{
AutoPtr<DatePickerCalendarDelegateSavedState> ss = (DatePickerCalendarDelegateSavedState*) state;
mCurrentDate->Set(ss->GetSelectedYear(), ss->GetSelectedMonth(), ss->GetSelectedDay());
mCurrentView = ss->GetCurrentView();
mMinDate->SetTimeInMillis(ss->GetMinDate());
mMaxDate->SetTimeInMillis(ss->GetMaxDate());
UpdateDisplay(FALSE);
SetCurrentView(mCurrentView);
Int32 listPosition = ss->GetListPosition();
if (listPosition != -1) {
if (mCurrentView == MONTH_AND_DAY_VIEW) {
mDayPickerView->PostSetSelection(listPosition);
}
else if (mCurrentView == YEAR_VIEW) {
mYearPickerView->PostSetSelectionFromTop(listPosition, ss->GetListPositionOffset());
}
}
return NOERROR;
}
ECode DatePickerCalendarDelegate::DispatchPopulateAccessibilityEvent(
/* [in] */ IAccessibilityEvent* event,
/* [out] */ Boolean* rst)
{
VALIDATE_NOT_NULL(rst)
OnPopulateAccessibilityEvent(event);
*rst = TRUE;
return NOERROR;
}
ECode DatePickerCalendarDelegate::OnPopulateAccessibilityEvent(
/* [in] */ IAccessibilityEvent* event)
{
AutoPtr<IDate> d;
mCurrentDate->GetTime((IDate**)&d);
String str;
d->ToString(&str);
AutoPtr<IList> l;
IAccessibilityRecord::Probe(event)->GetText((IList**)&l);
l->Add(CoreUtils::Convert(str));
return NOERROR;
}
ECode DatePickerCalendarDelegate::OnInitializeAccessibilityEvent(
/* [in] */ IAccessibilityEvent* event)
{
IAccessibilityRecord::Probe(event)->SetClassName(CoreUtils::Convert("CDatePickerCalendarDelegate"));
return NOERROR;
}
ECode DatePickerCalendarDelegate::OnInitializeAccessibilityNodeInfo(
/* [in] */ IAccessibilityNodeInfo* info)
{
info->SetClassName(CoreUtils::Convert("CDatePickerCalendarDelegate"));
return NOERROR;
}
ECode DatePickerCalendarDelegate::OnYearSelected(
/* [in] */ Int32 year)
{
Int32 m = 0;
mCurrentDate->Get(ICalendar::MONTH, &m);
AdjustDayInMonthIfNeeded(m, year);
mCurrentDate->Set(ICalendar::YEAR, year);
UpdatePickers();
SetCurrentView(MONTH_AND_DAY_VIEW);
UpdateDisplay(TRUE);
return NOERROR;
}
void DatePickerCalendarDelegate::AdjustDayInMonthIfNeeded(
/* [in] */ Int32 month,
/* [in] */ Int32 year)
{
Int32 day = 0;
mCurrentDate->Get(ICalendar::DAY_OF_MONTH, &day);
Int32 daysInMonth = 0;
daysInMonth = GetDaysInMonth(month, year);
if (day > daysInMonth) {
mCurrentDate->Set(ICalendar::DAY_OF_MONTH, daysInMonth);
}
}
Int32 DatePickerCalendarDelegate::GetDaysInMonth(
/* [in] */ Int32 month,
/* [in] */ Int32 year)
{
switch (month) {
case ICalendar::JANUARY:
case ICalendar::MARCH:
case ICalendar::MAY:
case ICalendar::JULY:
case ICalendar::AUGUST:
case ICalendar::OCTOBER:
case ICalendar::DECEMBER:
return 31;
case ICalendar::APRIL:
case ICalendar::JUNE:
case ICalendar::SEPTEMBER:
case ICalendar::NOVEMBER:
return 30;
case ICalendar::FEBRUARY:
return (year % 4 == 0) ? 29 : 28;
default:
return -1;
// throw new IllegalArgumentException("Invalid Month");
}
}
ECode DatePickerCalendarDelegate::OnDayOfMonthSelected(
/* [in] */ Int32 year,
/* [in] */ Int32 month,
/* [in] */ Int32 day)
{
mCurrentDate->Set(ICalendar::YEAR, year);
mCurrentDate->Set(ICalendar::MONTH, month);
mCurrentDate->Set(ICalendar::DAY_OF_MONTH, day);
UpdatePickers();
UpdateDisplay(TRUE);
return NOERROR;
}
void DatePickerCalendarDelegate::UpdatePickers()
{
AutoPtr<IIterator> it;
mListeners->GetIterator((IIterator**)&it);
Boolean b = FALSE;
while ((it->HasNext(&b), b)) {
AutoPtr<IInterface> p;
it->GetNext((IInterface**)&p);
AutoPtr<IOnDateChangedListener> listener = IOnDateChangedListener::Probe(p);
listener->OnDateChanged();
}
}
ECode DatePickerCalendarDelegate::RegisterOnDateChangedListener(
/* [in] */ IOnDateChangedListener* listener)
{
mListeners->Add(listener);
return NOERROR;
}
ECode DatePickerCalendarDelegate::UnregisterOnDateChangedListener(
/* [in] */ IOnDateChangedListener* listener)
{
mListeners->Remove(listener);
return NOERROR;
}
ECode DatePickerCalendarDelegate::GetSelectedDay(
/* [out] */ ICalendar** day)
{
VALIDATE_NOT_NULL(day)
*day = mCurrentDate;
REFCOUNT_ADD(*day)
return NOERROR;
}
ECode DatePickerCalendarDelegate::TryVibrate()
{
Boolean b = FALSE;
IView::Probe(mDelegator)->PerformHapticFeedback(IHapticFeedbackConstants::CALENDAR_DATE, &b);
return NOERROR;
}
ECode DatePickerCalendarDelegate::OnClick(
/* [in] */ IView* v)
{
TryVibrate();
Int32 id = 0;
v->GetId(&id);
if (id == R::id::date_picker_year) {
SetCurrentView(YEAR_VIEW);
}
else if (id == R::id::date_picker_month_and_day_layout) {
SetCurrentView(MONTH_AND_DAY_VIEW);
}
return NOERROR;
}
} // namespace Widget
} // namespace Droid
} // namespace Elastos
| 33.790066 | 115 | 0.689299 | [
"object"
] |
d042ca7db4f67b301f191963036ef24a07329c51 | 9,474 | cpp | C++ | Samples/UWP/D3D12PipelineStateCache/src/PSOLibrary.cpp | dsrour/DSX2 | e3489ff4bc3d49ed00480b4a6eb14ac08f6f98e7 | [
"MIT"
] | 52 | 2016-01-26T18:22:02.000Z | 2022-02-12T05:22:02.000Z | Samples/UWP/D3D12PipelineStateCache/src/PSOLibrary.cpp | dsrour/DSX2 | e3489ff4bc3d49ed00480b4a6eb14ac08f6f98e7 | [
"MIT"
] | 1 | 2019-07-14T07:22:52.000Z | 2019-07-14T07:22:52.000Z | Samples/UWP/D3D12PipelineStateCache/src/PSOLibrary.cpp | dsrour/DSX2 | e3489ff4bc3d49ed00480b4a6eb14ac08f6f98e7 | [
"MIT"
] | 22 | 2016-01-27T05:07:27.000Z | 2021-12-09T19:19:06.000Z | //*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
#include "stdafx.h"
#include "PSOLibrary.h"
using namespace Microsoft::WRL::Wrappers;
PSOLibrary::PSOLibrary(UINT frameCount, UINT cbvRootSignatureIndex) :
m_cbvRootSignatureIndex(cbvRootSignatureIndex),
m_maxDrawsPerFrame(256),
m_dynamicCB(sizeof(UberShaderConstantBuffer), m_maxDrawsPerFrame, frameCount),
m_flagsMutex(),
m_useUberShaders(true),
m_useDiskLibraries(true),
m_drawIndex(0)
{
ZeroMemory(m_compiledPSOFlags, sizeof(m_compiledPSOFlags));
ZeroMemory(m_inflightPSOFlags, sizeof(m_inflightPSOFlags));
ZeroMemory(m_workerThreads, sizeof(m_workerThreads));
WCHAR path[512];
GetAssetsPath(path, _countof(path));
m_assetsPath = path;
m_flagsMutex = CreateMutex(nullptr, FALSE, nullptr);
}
PSOLibrary::~PSOLibrary()
{
WaitForThreads();
for (UINT i = 0; i < EffectPipelineTypeCount; i++)
{
m_diskCaches[i].Destroy(false);
}
}
void PSOLibrary::WaitForThreads()
{
for (auto& thread : m_workerThreads)
{
if (thread.threadHandle)
{
WaitForSingleObject(thread.threadHandle, INFINITE);
CloseHandle(thread.threadHandle);
}
thread.threadHandle = nullptr;
}
}
void PSOLibrary::Build(ID3D12Device* pDevice, ID3D12RootSignature* pRootSignature)
{
for (UINT i = 0; i < EffectPipelineTypeCount; i++)
{
m_diskCaches[i].Init(m_assetsPath + g_cCacheFileNames[i]);
}
// Always compile the 3D shader and the Ubershader.
for (UINT i = 0; i < BaseEffectCount; i++)
{
m_workerThreads[i].pDevice = pDevice;
m_workerThreads[i].pRootSignature = pRootSignature;
m_workerThreads[i].type = EffectPipelineType(i);
m_workerThreads[i].pLibrary = this;
CompilePSO(&m_workerThreads[i]);
}
m_dynamicCB.Init(pDevice);
}
void PSOLibrary::SetPipelineState(
ID3D12Device* pDevice,
ID3D12RootSignature* pRootSignature,
ID3D12GraphicsCommandList* pCommandList,
_In_range_(0, EffectPipelineTypeCount-1) EffectPipelineType type,
UINT frameIndex)
{
assert(m_drawIndex < m_maxDrawsPerFrame);
bool isBuilt = false;
bool isInFlight = false;
{
// Take the lock to figure out if we need to build this thing or use an Uber shader.
auto lock = Mutex::Lock(m_flagsMutex);
isBuilt = m_compiledPSOFlags[type];
isInFlight = m_inflightPSOFlags[type];
}
if (type > BaseUberShader)
{
// If an effect hasn't been built yet.
if (!isBuilt && m_useUberShaders)
{
// Let the uber shader know what effect it should configure for.
UberShaderConstantBuffer* constantData = (UberShaderConstantBuffer*)m_dynamicCB.GetMappedMemory(m_drawIndex, frameIndex);
constantData->effectIndex = type;
pCommandList->SetGraphicsRootConstantBufferView(m_cbvRootSignatureIndex, m_dynamicCB.GetGpuVirtualAddress(m_drawIndex, frameIndex));
// We don't want to double compile.
if (!isInFlight)
{
m_workerThreads[type].pDevice = pDevice;
m_workerThreads[type].pRootSignature = pRootSignature;
m_workerThreads[type].type = type;
m_workerThreads[type].pLibrary = this;
// Compile the PSO on a background thread.
m_workerThreads[type].threadHandle = CreateThread(
nullptr,
0,
reinterpret_cast<LPTHREAD_START_ROUTINE>(CompilePSO),
reinterpret_cast<void*>(&m_workerThreads[type]),
CREATE_SUSPENDED,
nullptr);
if (!m_workerThreads[type].threadHandle)
{
ThrowIfFailed(HRESULT_FROM_WIN32(GetLastError()));
}
ResumeThread(m_workerThreads[type].threadHandle);
{
auto lock = Mutex::Lock(m_flagsMutex);
m_inflightPSOFlags[type] = true;
}
}
type = BaseUberShader;
}
else if (!isBuilt && !m_useUberShaders)
{
// When not using ubershaders this will take a long time and cause a hitch as the
// CPU is stalled!
m_workerThreads[type].pDevice = pDevice;
m_workerThreads[type].pRootSignature = pRootSignature;
m_workerThreads[type].type = type;
m_workerThreads[type].pLibrary = this;
CompilePSO(&m_workerThreads[type]);
}
}
else
{
// We should always have the base shaders around.
assert(isBuilt);
}
pCommandList->SetPipelineState(m_pipelineStates[type].Get());
m_drawIndex++;
}
void PSOLibrary::CompilePSO(CompilePSOThreadData* pDataPackage)
{
PSOLibrary* pLibrary = pDataPackage->pLibrary;
ID3D12Device* pDevice = pDataPackage->pDevice;
ID3D12RootSignature* pRootSignature = pDataPackage->pRootSignature;
EffectPipelineType type = pDataPackage->type;
bool useCache = false;
{
auto lock = Mutex::Lock(pLibrary->m_flagsMutex);
// When using the disk cache compilation should be extremely quick so don't sleep.
useCache = pLibrary->m_useDiskLibraries;
}
if (useCache && pLibrary->m_diskCaches[type].GetPointerToStartOfFile() == nullptr)
{
pLibrary->m_diskCaches[type].Init(pLibrary->m_assetsPath + g_cCacheFileNames[type]);
}
D3D12_GRAPHICS_PIPELINE_STATE_DESC baseDesc = {};
baseDesc.pRootSignature = pRootSignature;
baseDesc.SampleMask = UINT_MAX;
baseDesc.RasterizerState = CD3DX12_RASTERIZER_DESC(D3D12_DEFAULT);
baseDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
baseDesc.NumRenderTargets = 1;
baseDesc.RTVFormats[0] = DXGI_FORMAT_R8G8B8A8_UNORM;
baseDesc.SampleDesc.Count = 1;
baseDesc.BlendState = CD3DX12_BLEND_DESC(D3D12_DEFAULT);
baseDesc.DepthStencilState.DepthEnable = FALSE;
baseDesc.DepthStencilState.StencilEnable = FALSE;
baseDesc.InputLayout = g_cEffectShaderData[type].inputLayout;
baseDesc.VS = g_cEffectShaderData[type].VS;
baseDesc.PS = g_cEffectShaderData[type].PS;
baseDesc.DS = g_cEffectShaderData[type].DS;
baseDesc.HS = g_cEffectShaderData[type].HS;
baseDesc.GS = g_cEffectShaderData[type].GS;
if (useCache && pLibrary->m_diskCaches[type].GetPointerToStartOfFile() != nullptr)
{
// Read how long the cached shader blob is.
UINT size = pLibrary->m_diskCaches[type].GetCachedBlobSize();
// If the size if 0 then this disk cache needs to be refreshed.
if (size == 0)
{
ThrowIfFailed(pDevice->CreateGraphicsPipelineState(&baseDesc, IID_PPV_ARGS(&pLibrary->m_pipelineStates[type])));
ComPtr<ID3DBlob> blob;
pLibrary->m_pipelineStates[type]->GetCachedBlob(&blob);
pLibrary->m_diskCaches[type].Update(blob.Get());
// The effects are very simple and should compile quickly so we'll sleep to emulate something more complex.
if (type > BaseUberShader)
{
Sleep(500);
}
}
else
{
// Read in the blob data from disk to avoid compiling it.
baseDesc.CachedPSO.pCachedBlob = pLibrary->m_diskCaches[type].GetCachedBlob();
baseDesc.CachedPSO.CachedBlobSizeInBytes = pLibrary->m_diskCaches[type].GetCachedBlobSize();
HRESULT hr = pDevice->CreateGraphicsPipelineState(&baseDesc, IID_PPV_ARGS(&pLibrary->m_pipelineStates[type]));
// If compilation fails the cache is probably stale. (old drivers etc.)
if (FAILED(hr))
{
baseDesc.CachedPSO = {};
ThrowIfFailed(pDevice->CreateGraphicsPipelineState(&baseDesc, IID_PPV_ARGS(&pLibrary->m_pipelineStates[type])));
ComPtr<ID3DBlob> blob;
pLibrary->m_pipelineStates[type]->GetCachedBlob(&blob);
pLibrary->m_diskCaches[type].Update(blob.Get());
// The effects are few and very simple and should compile quickly so we'll sleep to emulate something more complex.
if (type > BaseUberShader)
{
Sleep(500);
}
}
}
}
else
{
ThrowIfFailed(pDevice->CreateGraphicsPipelineState(&baseDesc, IID_PPV_ARGS(&pLibrary->m_pipelineStates[type])));
// The effects are few and very simple and should compile quickly so we'll sleep to emulate something more complex.
if (type > BaseUberShader)
{
Sleep(500);
}
}
WCHAR name[50];
if (swprintf_s(name, L"m_pipelineStates[%s]", g_cEffectNames[type]) > 0)
{
SetName(pLibrary->m_pipelineStates[type].Get(), name);
}
{
auto lock = Mutex::Lock(pLibrary->m_flagsMutex);
pLibrary->m_compiledPSOFlags[type] = true;
pLibrary->m_inflightPSOFlags[type] = false;
}
}
void PSOLibrary::EndFrame()
{
m_drawIndex = 0;
}
void PSOLibrary::ClearPSOCache()
{
WaitForThreads();
for (size_t i = PostBlit; i < EffectPipelineTypeCount; i++)
{
if (m_pipelineStates[i])
{
m_pipelineStates[i] = nullptr;
m_compiledPSOFlags[i] = false;
m_inflightPSOFlags[i] = false;
}
}
// Clear the disk caches.
for (size_t i = 0; i < EffectPipelineTypeCount; i++)
{
m_diskCaches[i].Destroy(true);
}
}
void PSOLibrary::ToggleUberShader()
{
m_useUberShaders = !m_useUberShaders;
}
void PSOLibrary::ToggleDiskLibrary()
{
{
auto lock = Mutex::Lock(m_flagsMutex);
m_useDiskLibraries = !m_useDiskLibraries;
}
WaitForThreads();
}
void PSOLibrary::DestroyShader(EffectPipelineType type)
{
WaitForThreads();
if (m_pipelineStates[type])
{
m_pipelineStates[type] = nullptr;
m_compiledPSOFlags[type] = false;
m_inflightPSOFlags[type] = false;
}
}
| 28.622356 | 136 | 0.703188 | [
"3d"
] |
d043cabc2fdc25dfcb1eaf2258424530fd329a51 | 401,421 | cxx | C++ | PWGHF/vertexingHF/TMVA/LHC19c2a_TMVAClassification_BDT_2_4.class.cxx | maroozm/AliPhysics | 22ec256928cfdf8f800e05bfc1a6e124d90b6eaf | [
"BSD-3-Clause"
] | 114 | 2017-03-03T09:12:23.000Z | 2022-03-03T20:29:42.000Z | PWGHF/vertexingHF/TMVA/LHC19c2a_TMVAClassification_BDT_2_4.class.cxx | maroozm/AliPhysics | 22ec256928cfdf8f800e05bfc1a6e124d90b6eaf | [
"BSD-3-Clause"
] | 19,637 | 2017-01-16T12:34:41.000Z | 2022-03-31T22:02:40.000Z | PWGHF/vertexingHF/TMVA/LHC19c2a_TMVAClassification_BDT_2_4.class.cxx | maroozm/AliPhysics | 22ec256928cfdf8f800e05bfc1a6e124d90b6eaf | [
"BSD-3-Clause"
] | 1,021 | 2016-07-14T22:41:16.000Z | 2022-03-31T05:15:51.000Z | #include "LHC19c2a_TMVAClassification_BDT_2_4.class.h"
double ReadBDT_LHC19c2a_2_4::GetMvaValue__( const std::vector<double>& inputValues ) const
{
double myMVA = 0;
double norm = 0;
for (unsigned int itree=0; itree<fForest.size(); itree++){
BDTNode *current = fForest[itree];
while (current->GetNodeType() == 0) { //intermediate node
if (current->GoesRight(inputValues)) current=(BDTNode*)current->GetRight();
else current=(BDTNode*)current->GetLeft();
}
myMVA += fBoostWeights[itree] * current->GetNodeType();
norm += fBoostWeights[itree];
}
return myMVA /= norm;
};
void ReadBDT_LHC19c2a_2_4::Initialize()
{
// itree = 0
fBoostWeights.push_back(0.545427558316838);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.999864, 0, 1, 0.792499,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.330184,-99) ,
5, 0.999048, 0, 0, 0.745576,-99) ,
NN(
NN(
0,
0,
-1, -0.420594, 1, 1, 0.727394,-99) ,
NN(
0,
0,
-1, -1.57143, 0, -1, 0.266275,-99) ,
12, 3.57611, 0, 0, 0.372636,-99) ,
9, -948.705, 0, 0, 0.499686,-99) );
// itree = 1
fBoostWeights.push_back(0.412166);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.192967, 1, 1, 0.75182,-99) ,
NN(
0,
0,
-1, 1.91269, 0, -1, 0.439379,-99) ,
5, 0.999524, 0, 0, 0.702984,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.7435,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.430487,-99) ,
6, -0.420571, 1, 0, 0.67155,-99) ,
NN(
0,
0,
-1, -1.57143, 0, -1, 0.325013,-99) ,
12, 3.57208, 0, 0, 0.404834,-99) ,
9, -948.705, 0, 0, 0.505244,-99) );
// itree = 2
fBoostWeights.push_back(0.323005);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.371427, 1, 1, 0.622596,-99) ,
NN(
0,
0,
-1, 1.3745, 0, -1, 0.257901,-99) ,
10, -1.57144, 0, 0, 0.575594,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509759,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478471,-99) ,
3, 1.91256, 0, 0, 0.49432,-99) ,
NN(
0,
0,
-1, 0.998617, 0, -1, 0.175094,-99) ,
9, -951.223, 0, 0, 0.267947,-99) ,
5, 0.999524, 0, 0, 0.518105,-99) );
// itree = 3
fBoostWeights.push_back(0.317771);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.189028, 1, 1, 0.672439,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.37124,-99) ,
5, 0.998572, 0, 0, 0.64811,-99) ,
NN(
NN(
0,
0,
-1, -0.624916, 1, 1, 0.667055,-99) ,
NN(
0,
0,
-1, -1.85716, 0, -1, 0.359164,-99) ,
11, 2.91762, 0, 0, 0.420616,-99) ,
9, -949.13, 0, 0, 0.497064,-99) );
// itree = 4
fBoostWeights.push_back(0.2591);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.583877,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.125351,-99) ,
7, 0.0476053, 1, 0, 0.568286,-99) ,
NN(
0,
0,
-1, 1.40932, 0, -1, 0.223949,-99) ,
10, -1.85708, 0, 0, 0.53831,-99) ,
NN(
0,
0,
-1, -949.113, 0, -1, 0.2551,-99) ,
5, 0.999048, 0, 0, 0.50252,-99) );
// itree = 5
fBoostWeights.push_back(0.212772);
fForest.push_back(
NN(
NN(
0,
0,
-1, -0.10049, 1, 1, 0.599031,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525037,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.263851,-99) ,
5, 0.999524, 0, 0, 0.475411,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521308,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.163377,-99) ,
3, 1.56089, 0, 0, 0.237793,-99) ,
10, -1.28569, 0, 0, 0.426297,-99) ,
9, -949.024, 0, 0, 0.484034,-99) );
// itree = 6
fBoostWeights.push_back(0.170518);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.538435, 1, 1, 0.653774,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.596744,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480349,-99) ,
11, -2.12708, 1, 0, 0.509788,-99) ,
6, -0.192697, 1, 0, 0.569579,-99) ,
NN(
0,
0,
-1, -1.85714, 0, -1, 0.416715,-99) ,
9, -949.024, 0, 0, 0.467785,-99) );
// itree = 7
fBoostWeights.push_back(0.149479);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.532961,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.136996,-99) ,
7, 0.0476053, 1, 0, 0.519663,-99) ,
NN(
0,
0,
-1, 0.996168, 0, -1, 0.226071,-99) ,
5, 0.998095, 0, 0, 0.499275,-99) ,
NN(
0,
0,
-1, -2.5102, 0, -1, 0.174475,-99) ,
10, -2.14285, 0, 0, 0.48193,-99) );
// itree = 8
fBoostWeights.push_back(0.211965);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.694843, 1, 1, 0.656277,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473515,-99) ,
7, 0.0238027, 1, 0, 0.622583,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.64528,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.451694,-99) ,
3, 1.9478, 0, 0, 0.601167,-99) ,
NN(
0,
0,
-1, -1.57144, 0, -1, 0.406086,-99) ,
11, -2.01833, 1, 0, 0.436938,-99) ,
11, 4.22601, 0, 0, 0.469232,-99) );
// itree = 9
fBoostWeights.push_back(0.155621);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.006792, 0, 1, 0.618557,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464694,-99) ,
7, 0.0237723, 1, 0, 0.595025,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507689,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.20705,-99) ,
5, 0.997143, 0, 0, 0.485215,-99) ,
NN(
0,
0,
-1, 1.8634, 0, -1, 0.258754,-99) ,
3, 1.34708, 0, 0, 0.44426,-99) ,
11, 2.10924, 0, 0, 0.482679,-99) );
// itree = 10
fBoostWeights.push_back(0.111102);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51537,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.161623,-99) ,
7, 0.0475829, 1, 0, 0.504121,-99) ,
NN(
0,
0,
-1, -951.286, 0, -1, 0.284646,-99) ,
5, 0.998571, 0, 0, 0.484693,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.200361,-99) ,
10, -2.14285, 0, 0, 0.470445,-99) );
// itree = 11
fBoostWeights.push_back(0.157575);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.487595, 1, 1, 0.59038,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535972,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445164,-99) ,
11, -2.37326, 1, 0, 0.468004,-99) ,
6, 0.0760373, 1, 0, 0.541569,-99) ,
NN(
0,
0,
-1, -1.57139, 0, -1, 0.419928,-99) ,
9, -948.526, 0, 0, 0.460677,-99) );
// itree = 12
fBoostWeights.push_back(0.162759);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.814743, 1, 1, 0.63894,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.582516,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496048,-99) ,
12, 4.71664, 1, 0, 0.530656,-99) ,
6, -0.646346, 1, 0, 0.579226,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51402,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.247412,-99) ,
10, 1.57151, 1, 0, 0.486147,-99) ,
NN(
0,
0,
-1, 1.77068, 0, -1, 0.327818,-99) ,
3, 1.49228, 0, 0, 0.437026,-99) ,
11, 2.32414, 0, 0, 0.471475,-99) );
// itree = 13
fBoostWeights.push_back(0.1443);
fForest.push_back(
NN(
NN(
0,
0,
-1, -0.687178, 1, 1, 0.573425,-99) ,
NN(
0,
0,
-1, 1.28621, 0, -1, 0.428955,-99) ,
11, 2.10924, 0, 0, 0.465874,-99) );
// itree = 14
fBoostWeights.push_back(0.183483);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.607012,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.436844,-99) ,
5, 0.999524, 0, 0, 0.58335,-99) ,
NN(
0,
0,
-1, -2.14287, 0, -1, 0.427894,-99) ,
7, 0.00679749, 0, 0, 0.484289,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.151968,-99) ,
7, 0.0475829, 1, 0, 0.474063,-99) );
// itree = 15
fBoostWeights.push_back(0.17958);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.56749,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.349949,-99) ,
10, -1.85715, 0, 0, 0.551589,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.621418,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.412436,-99) ,
11, -2.67325, 1, 0, 0.428034,-99) ,
7, 0.00453362, 0, 0, 0.493397,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.170391,-99) ,
7, 0.0476053, 1, 0, 0.483627,-99) );
// itree = 16
fBoostWeights.push_back(0.0873739);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5148,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.243653,-99) ,
5, 0.996667, 0, 0, 0.503659,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.247439,-99) ,
10, -2.14285, 0, 0, 0.491913,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.178993,-99) ,
7, 0.0476053, 1, 0, 0.48271,-99) );
// itree = 17
fBoostWeights.push_back(0.0560597);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501512,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.249108,-99) ,
5, 0.996667, 0, 0, 0.491386,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.192837,-99) ,
10, -2.42858, 0, 0, 0.483322,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.188661,-99) ,
7, 0.0476053, 1, 0, 0.474742,-99) );
// itree = 18
fBoostWeights.push_back(0.0643711);
fForest.push_back(
NN(
0,
0,
-1, 0.0476028, 1, -1, 0.467859,-99) );
// itree = 19
fBoostWeights.push_back(0.0641882);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504673,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.249326,-99) ,
10, 2.02039, 1, 0, 0.494629,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.26558,-99) ,
10, -2.14284, 0, 0, 0.484393,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.197236,-99) ,
7, 0.0476028, 1, 0, 0.476284,-99) );
// itree = 20
fBoostWeights.push_back(0.13396);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530318,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.312022,-99) ,
10, -2.14284, 0, 0, 0.520477,-99) ,
NN(
0,
0,
-1, 1.88882, 0, -1, 0.398556,-99) ,
5, 0.999909, 0, 0, 0.490991,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502599,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487157,-99) ,
0, 0.49809, 1, 0, 0.495398,-99) ,
NN(
0,
0,
-1, 2.02718, 0, -1, 0.303282,-99) ,
9, -949.113, 0, 0, 0.368714,-99) ,
5, 0.999524, 0, 0, 0.469912,-99) );
// itree = 21
fBoostWeights.push_back(0.0911197);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507339,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.384442,-99) ,
10, -1.1497, 0, 0, 0.483545,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.280284,-99) ,
10, 1.85708, 1, 0, 0.473488,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.191186,-99) ,
7, 0.0475804, 1, 0, 0.465498,-99) );
// itree = 22
fBoostWeights.push_back(0.165005);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.55626,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475379,-99) ,
6, 0.166616, 1, 0, 0.528441,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.615101,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.412291,-99) ,
11, -1.99939, 1, 0, 0.436316,-99) ,
9, -948.526, 0, 0, 0.467445,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.203985,-99) ,
7, 0.0476028, 1, 0, 0.460026,-99) );
// itree = 23
fBoostWeights.push_back(0.111825);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.592945,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494536,-99) ,
3, 1.8967, 0, 0, 0.515821,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5156,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.402944,-99) ,
3, 2.06946, 0, 0, 0.431228,-99) ,
7, 0.00453363, 0, 0, 0.475911,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.209003,-99) ,
7, 0.0476053, 1, 0, 0.468566,-99) );
// itree = 24
fBoostWeights.push_back(0.115399);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.567216,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46581,-99) ,
7, 0.00906753, 0, 0, 0.491747,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.230181,-99) ,
7, 0.0476053, 1, 0, 0.484518,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.281274,-99) ,
5, 0.997619, 0, 0, 0.47431,-99) );
// itree = 25
fBoostWeights.push_back(0.050576);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504517,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.263585,-99) ,
10, 2.14283, 1, 0, 0.497821,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.247972,-99) ,
7, 0.0476028, 1, 0, 0.491033,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.246694,-99) ,
5, 0.99619, 0, 0, 0.482998,-99) );
// itree = 26
fBoostWeights.push_back(0.0842271);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514519,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.423495,-99) ,
5, 0.999796, 0, 0, 0.492825,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.239854,-99) ,
7, 0.0476053, 1, 0, 0.486032,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.23887,-99) ,
5, 0.995714, 0, 0, 0.478887,-99) );
// itree = 27
fBoostWeights.push_back(0.109264);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.544423,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.458087,-99) ,
3, 1.75556, 0, 0, 0.486963,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.265007,-99) ,
10, 2.1428, 1, 0, 0.480902,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.25597,-99) ,
5, 0.996191, 0, 0, 0.473543,-99) );
// itree = 28
fBoostWeights.push_back(0.125029);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.806949, 1, 1, 0.60035,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.424312,-99) ,
5, 0.999905, 0, 0, 0.564311,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.65935,-99) ,
NN(
0,
0,
-1, -1.28573, 0, -1, 0.449914,-99) ,
11, -2.89831, 1, 0, 0.460336,-99) ,
6, -0.549733, 1, 0, 0.477762,-99) );
// itree = 29
fBoostWeights.push_back(0.0788435);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517091,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.410114,-99) ,
10, -1.28573, 0, 0, 0.500736,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.272729,-99) ,
5, 0.995714, 0, 0, 0.494341,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.253707,-99) ,
7, 0.0476053, 1, 0, 0.48807,-99) );
// itree = 30
fBoostWeights.push_back(0.0501888);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504047,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.316052,-99) ,
5, 0.996667, 0, 0, 0.497305,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.27915,-99) ,
10, -2.30613, 0, 0, 0.490336,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.316819,-99) ,
10, 1.85708, 1, 0, 0.482124,-99) );
// itree = 31
fBoostWeights.push_back(0.0891815);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.999962, 1, 1, 0.546606,-99) ,
NN(
0,
0,
-1, 1.19666, 0, -1, 0.463141,-99) ,
11, 2.10924, 0, 0, 0.484089,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.261797,-99) ,
7, 0.0476028, 1, 0, 0.478314,-99) );
// itree = 32
fBoostWeights.push_back(0.0384003);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501865,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.307251,-99) ,
5, 0.995715, 0, 0, 0.496594,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.302376,-99) ,
10, -2.26531, 0, 0, 0.490067,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.279049,-99) ,
10, 2.14279, 1, 0, 0.48422,-99) );
// itree = 33
fBoostWeights.push_back(0.0543278);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503552,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.377905,-99) ,
7, 0.0238014, 1, 0, 0.495307,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.281246,-99) ,
10, -2.34694, 0, 0, 0.488884,-99) ,
NN(
0,
0,
-1, -0.0129055, 1, -1, 0.357124,-99) ,
10, 1.57141, 1, 0, 0.47881,-99) );
// itree = 34
fBoostWeights.push_back(0.0799025);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.36043, 0, 1, 0.5139,-99) ,
NN(
0,
0,
-1, -949.13, 0, -1, 0.441551,-99) ,
7, 0.00453377, 0, 0, 0.479957,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.2669,-99) ,
7, 0.0476053, 1, 0, 0.474514,-99) );
// itree = 35
fBoostWeights.push_back(0.104764);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -2.9386, 1, 1, 0.53635,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51345,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.417769,-99) ,
12, 2.59625, 0, 0, 0.461103,-99) ,
3, 1.93411, 0, 0, 0.479848,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.278618,-99) ,
10, 2.1428, 1, 0, 0.474318,-99) );
// itree = 36
fBoostWeights.push_back(0.102478);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.602922,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497266,-99) ,
6, -0.0103161, 1, 0, 0.520309,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509948,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.365689,-99) ,
11, 1.01168, 0, 0, 0.452919,-99) ,
3, 1.59861, 0, 0, 0.482627,-99) ,
NN(
0,
0,
-1, -0.0104552, 1, -1, 0.360866,-99) ,
10, 1.57138, 1, 0, 0.473462,-99) );
// itree = 37
fBoostWeights.push_back(0.0908725);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528925,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45938,-99) ,
3, 1.74151, 0, 0, 0.484597,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.298048,-99) ,
10, 2.14283, 1, 0, 0.4795,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.290816,-99) ,
7, 0.0476028, 1, 0, 0.474557,-99) );
// itree = 38
fBoostWeights.push_back(0.0936501);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.532811,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466076,-99) ,
5, 0.999981, 0, 0, 0.499652,-99) ,
NN(
0,
0,
-1, 1.61555, 0, -1, 0.430101,-99) ,
5, 0.999796, 0, 0, 0.483243,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.285808,-99) ,
5, 0.995715, 0, 0, 0.477849,-99) );
// itree = 39
fBoostWeights.push_back(0.0794574);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.542053,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473792,-99) ,
11, -1.20333, 1, 0, 0.491646,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.319958,-99) ,
5, 0.996191, 0, 0, 0.486244,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.286349,-99) ,
7, 0.0476028, 1, 0, 0.481114,-99) );
// itree = 40
fBoostWeights.push_back(0.0718622);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517439,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4191,-99) ,
7, 0.0237802, 1, 0, 0.510505,-99) ,
NN(
0,
0,
-1, 1.58634, 0, -1, 0.449273,-99) ,
5, 0.999887, 0, 0, 0.492111,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.360639,-99) ,
5, 0.997619, 0, 0, 0.485706,-99) );
// itree = 41
fBoostWeights.push_back(0.0618641);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510374,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.440889,-99) ,
0, 0.501899, 1, 0, 0.497695,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.307064,-99) ,
10, -2.34694, 0, 0, 0.492147,-99) ,
NN(
0,
0,
-1, -0.0082311, 1, -1, 0.387546,-99) ,
10, 1.57141, 1, 0, 0.484349,-99) );
// itree = 42
fBoostWeights.push_back(0.0643065);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.597789,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491858,-99) ,
3, 2.39456, 0, 0, 0.500324,-99) ,
NN(
0,
0,
-1, -951.203, 0, -1, 0.435421,-99) ,
7, 0.00226659, 0, 0, 0.484045,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.298225,-99) ,
7, 0.0475984, 1, 0, 0.479302,-99) );
// itree = 43
fBoostWeights.push_back(0.039379);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504491,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.403089,-99) ,
7, 0.0238014, 1, 0, 0.497873,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.362372,-99) ,
10, -2.14285, 0, 0, 0.492501,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.332658,-99) ,
5, 0.995714, 0, 0, 0.488165,-99) );
// itree = 44
fBoostWeights.push_back(0.0542989);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -951.286, 1, 1, 0.561596,-99) ,
NN(
0,
0,
-1, 0.999841, 0, -1, 0.481065,-99) ,
3, 2.37499, 0, 0, 0.488344,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.354465,-99) ,
5, 0.996667, 0, 0, 0.483619,-99) );
// itree = 45
fBoostWeights.push_back(0.0372195);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504508,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.394195,-99) ,
10, 1.77549, 1, 0, 0.498562,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.373738,-99) ,
10, -2.14286, 0, 0, 0.493617,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.335812,-99) ,
5, 0.995714, 0, 0, 0.489371,-99) );
// itree = 46
fBoostWeights.push_back(0.0705999);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533295,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485685,-99) ,
3, 1.59862, 0, 0, 0.50614,-99) ,
NN(
0,
0,
-1, -951.223, 0, -1, 0.442385,-99) ,
7, 0.00226689, 0, 0, 0.49018,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.310873,-99) ,
7, 0.0476053, 1, 0, 0.485666,-99) );
// itree = 47
fBoostWeights.push_back(0.0453248);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.83345, 1, 1, 0.574123,-99) ,
NN(
0,
0,
-1, 0.0237801, 1, -1, 0.486266,-99) ,
6, -0.731042, 1, 0, 0.49297,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.359525,-99) ,
5, 0.996667, 0, 0, 0.488267,-99) );
// itree = 48
fBoostWeights.push_back(0.0753856);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530763,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476267,-99) ,
3, 1.43113, 0, 0, 0.506286,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52889,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.376335,-99) ,
6, -0.105353, 1, 0, 0.436035,-99) ,
10, 1.28567, 1, 0, 0.498229,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.342951,-99) ,
5, 0.995715, 0, 0, 0.494111,-99) );
// itree = 49
fBoostWeights.push_back(0.0991398);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.551967,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.38515,-99) ,
10, -1.85719, 0, 0, 0.535321,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.561275,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463976,-99) ,
11, -2.3558, 1, 0, 0.477618,-99) ,
6, -0.279451, 1, 0, 0.498313,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.329212,-99) ,
7, 0.0476028, 1, 0, 0.494042,-99) );
// itree = 50
fBoostWeights.push_back(0.0880312);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524531,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455604,-99) ,
10, 1.09523, 1, 0, 0.511498,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.594146,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.411272,-99) ,
9, -949.657, 0, 0, 0.459112,-99) ,
10, -1, 0, 0, 0.500514,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.371023,-99) ,
5, 0.996191, 0, 0, 0.49661,-99) );
// itree = 51
fBoostWeights.push_back(0.0540142);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514669,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.429079,-99) ,
7, 0.0237858, 1, 0, 0.509367,-99) ,
NN(
0,
0,
-1, -951.223, 0, -1, 0.465592,-99) ,
0, 0.499995, 1, 0, 0.495454,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.382714,-99) ,
4, 9.79252, 1, 0, 0.491061,-99) );
// itree = 52
fBoostWeights.push_back(0.0942007);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533685,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.425316,-99) ,
5, 0.999672, 0, 0, 0.521498,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.342494,-99) ,
10, -2.14297, 0, 0, 0.511353,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.572315,-99) ,
NN(
0,
0,
-1, -0.159494, 0, -1, 0.454017,-99) ,
11, -2.68666, 1, 0, 0.467307,-99) ,
6, -0.099319, 1, 0, 0.489722,-99) );
// itree = 53
fBoostWeights.push_back(0.0749919);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534564,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474362,-99) ,
7, 0.00566648, 0, 0, 0.499587,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523086,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.290934,-99) ,
6, -0.466786, 1, 0, 0.414959,-99) ,
7, 0.0237992, 1, 0, 0.494249,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.387639,-99) ,
4, 9.79006, 1, 0, 0.490169,-99) );
// itree = 54
fBoostWeights.push_back(0.0584744);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.578256,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49674,-99) ,
7, 0.00793259, 0, 0, 0.514048,-99) ,
NN(
0,
0,
-1, 1.29238, 0, -1, 0.461883,-99) ,
3, 1.29674, 0, 0, 0.498174,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502888,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.274077,-99) ,
6, -0.37815, 1, 0, 0.410515,-99) ,
7, 0.0237992, 1, 0, 0.492683,-99) );
// itree = 55
fBoostWeights.push_back(0.0689929);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.548813,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.434057,-99) ,
12, -0.520757, 0, 0, 0.535758,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501718,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.395663,-99) ,
10, -1.28565, 0, 0, 0.48364,-99) ,
9, -948.526, 0, 0, 0.501934,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509581,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.303049,-99) ,
6, -0.463657, 1, 0, 0.413329,-99) ,
7, 0.0238027, 1, 0, 0.496404,-99) );
// itree = 56
fBoostWeights.push_back(0.0913627);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.548838,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466366,-99) ,
12, 3.91713, 1, 0, 0.529812,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.59034,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465107,-99) ,
3, 2.25281, 0, 0, 0.479506,-99) ,
9, -948.705, 0, 0, 0.497131,-99) ,
NN(
0,
0,
-1, -0.463145, 1, -1, 0.41168,-99) ,
7, 0.0238014, 1, 0, 0.491769,-99) );
// itree = 57
fBoostWeights.push_back(0.0562019);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519818,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476731,-99) ,
7, 0.0034003, 0, 0, 0.503596,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513648,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.329638,-99) ,
6, -0.467498, 1, 0, 0.42983,-99) ,
7, 0.0238027, 1, 0, 0.498907,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.389862,-99) ,
5, 0.996667, 0, 0, 0.495196,-99) );
// itree = 58
fBoostWeights.push_back(0.0536622);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524103,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483189,-99) ,
3, 1.61543, 0, 0, 0.501815,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503663,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.326467,-99) ,
6, -0.464049, 1, 0, 0.422529,-99) ,
7, 0.0238027, 1, 0, 0.496819,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.365694,-99) ,
10, 2.14283, 1, 0, 0.493478,-99) );
// itree = 59
fBoostWeights.push_back(0.0382519);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541978,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494305,-99) ,
7, 0.0101997, 0, 0, 0.502848,-99) ,
NN(
0,
0,
-1, -0.467091, 1, -1, 0.423892,-99) ,
7, 0.0238014, 1, 0, 0.497868,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.371483,-99) ,
5, 0.995715, 0, 0, 0.494617,-99) );
// itree = 60
fBoostWeights.push_back(0.0527606);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519725,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478705,-99) ,
3, 1.27697, 0, 0, 0.507231,-99) ,
NN(
0,
0,
-1, -0.465945, 1, -1, 0.431266,-99) ,
7, 0.0238027, 1, 0, 0.502462,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.410588,-99) ,
5, 0.997619, 0, 0, 0.498149,-99) );
// itree = 61
fBoostWeights.push_back(0.0715888);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.236697, 1, 1, 0.562638,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513909,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.286281,-99) ,
12, 0.964412, 0, 0, 0.494586,-99) ,
8, 1.59157, 0, 0, 0.513923,-99) ,
NN(
0,
0,
-1, 1.85719, 1, -1, 0.469998,-99) ,
6, -0.0113861, 1, 0, 0.49544,-99) );
// itree = 62
fBoostWeights.push_back(0.0265648);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.5715, 0, 1, 0.505505,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500636,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.345037,-99) ,
6, -0.465896, 1, 0, 0.429177,-99) ,
7, 0.0237915, 1, 0, 0.500695,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.406523,-99) ,
4, 9.3665, 1, 0, 0.496634,-99) );
// itree = 63
fBoostWeights.push_back(0.0494153);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514226,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472099,-99) ,
10, -0.687087, 0, 0, 0.501331,-99) ,
NN(
0,
0,
-1, -0.464049, 1, -1, 0.429826,-99) ,
7, 0.0238014, 1, 0, 0.49685,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.409427,-99) ,
10, 1.85709, 1, 0, 0.493005,-99) );
// itree = 64
fBoostWeights.push_back(0.0426077);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.586922,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504994,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46249,-99) ,
3, 1.28474, 0, 0, 0.493183,-99) ,
NN(
0,
0,
-1, 0.49809, 1, -1, 0.396273,-99) ,
7, 0.0238014, 1, 0, 0.487958,-99) ,
6, -0.82018, 1, 0, 0.491486,-99) );
// itree = 65
fBoostWeights.push_back(0.0537903);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.587652,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515239,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477022,-99) ,
9, -2.17862, 0, 0, 0.490217,-99) ,
NN(
0,
0,
-1, 0.49809, 1, -1, 0.398603,-99) ,
7, 0.0238027, 1, 0, 0.485325,-99) ,
6, -0.820122, 1, 0, 0.48895,-99) );
// itree = 66
fBoostWeights.push_back(0.0741073);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.629523, 0, 1, 0.600828,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517367,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.382426,-99) ,
11, 2.35586, 0, 0, 0.499331,-99) ,
8, 1.3546, 0, 0, 0.52025,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.625493,-99) ,
NN(
0,
0,
-1, -0.718097, 0, -1, 0.471603,-99) ,
11, -2.9485, 1, 0, 0.479811,-99) ,
6, -0.369451, 1, 0, 0.491673,-99) );
// itree = 67
fBoostWeights.push_back(0.0446666);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521697,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488539,-99) ,
3, 1.59861, 0, 0, 0.503659,-99) ,
NN(
0,
0,
-1, 1.77676, 0, -1, 0.443281,-99) ,
0, 0.503804, 1, 0, 0.498162,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.381022,-99) ,
10, 2.1428, 1, 0, 0.495215,-99) );
// itree = 68
fBoostWeights.push_back(0.0510058);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526486,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.405127,-99) ,
6, 0.16201, 1, 0, 0.518085,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502395,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.291981,-99) ,
8, 1.39206, 0, 0, 0.487758,-99) ,
12, 2.16808, 0, 0, 0.500636,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.40997,-99) ,
4, 9.79006, 1, 0, 0.497106,-99) );
// itree = 69
fBoostWeights.push_back(0.0509657);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521178,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471409,-99) ,
6, -0.101378, 1, 0, 0.509521,-99) ,
NN(
0,
0,
-1, 1.5675, 0, -1, 0.476113,-99) ,
12, 1.63016, 0, 0, 0.493178,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.395671,-99) ,
10, 2.14279, 1, 0, 0.490683,-99) );
// itree = 70
fBoostWeights.push_back(0.0465621);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.563362,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493953,-99) ,
6, -0.212898, 1, 0, 0.507385,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501001,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.368729,-99) ,
11, 1.7048, 0, 0, 0.472723,-99) ,
3, 1.28473, 0, 0, 0.496058,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.399559,-99) ,
5, 0.99619, 0, 0, 0.493267,-99) );
// itree = 71
fBoostWeights.push_back(0.0592926);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.29601, 1, 1, 0.516809,-99) ,
NN(
0,
0,
-1, 0.128118, 1, -1, 0.437379,-99) ,
10, 1.28568, 1, 0, 0.506511,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524643,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472011,-99) ,
6, -0.691788, 1, 0, 0.4884,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.264597,-99) ,
12, 1.32161, 0, 0, 0.469977,-99) ,
3, 1.28941, 0, 0, 0.494772,-99) );
// itree = 72
fBoostWeights.push_back(0.0428275);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511017,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476438,-99) ,
7, 0.00226626, 0, 0, 0.502056,-99) ,
NN(
0,
0,
-1, 0.5058, 1, -1, 0.446915,-99) ,
0, 0.503804, 1, 0, 0.497055,-99) ,
NN(
0,
0,
-1, -0.466946, 1, -1, 0.423263,-99) ,
7, 0.0237973, 1, 0, 0.492533,-99) );
// itree = 73
fBoostWeights.push_back(0.0342156);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.619473,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497762,-99) ,
11, -3.0059, 1, 0, 0.503072,-99) ,
NN(
0,
0,
-1, -0.585582, 1, -1, 0.461616,-99) ,
3, 1.12501, 0, 0, 0.495023,-99) ,
NN(
0,
0,
-1, -0.466996, 1, -1, 0.42551,-99) ,
7, 0.0238027, 1, 0, 0.490788,-99) );
// itree = 74
fBoostWeights.push_back(0.0571028);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.578225,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.549194,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48716,-99) ,
3, 1.77473, 0, 0, 0.500404,-99) ,
NN(
0,
0,
-1, -0.22046, 0, -1, 0.439558,-99) ,
6, 0.347878, 1, 0, 0.491225,-99) ,
3, 2.73084, 0, 0, 0.494444,-99) );
// itree = 75
fBoostWeights.push_back(0.0376512);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.562444,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497365,-99) ,
6, -0.209026, 1, 0, 0.510092,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501214,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.298049,-99) ,
12, 1.58378, 0, 0, 0.480161,-99) ,
3, 1.28942, 0, 0, 0.500274,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.406106,-99) ,
5, 0.995715, 0, 0, 0.497873,-99) );
// itree = 76
fBoostWeights.push_back(0.0339164);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.397254, 1, 1, 0.511468,-99) ,
NN(
0,
0,
-1, 3.03669, 0, -1, 0.477174,-99) ,
8, 1.34208, 0, 0, 0.502264,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.428169,-99) ,
4, 9.42577, 1, 0, 0.499116,-99) );
// itree = 77
fBoostWeights.push_back(0.0531413);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520123,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457029,-99) ,
6, 0.255413, 1, 0, 0.509655,-99) ,
NN(
0,
0,
-1, 1.27868, 0, -1, 0.473404,-99) ,
5, 0.999841, 0, 0, 0.500214,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.417393,-99) ,
5, 0.996667, 0, 0, 0.497452,-99) );
// itree = 78
fBoostWeights.push_back(0.0353987);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -2.83217, 1, 1, 0.5105,-99) ,
NN(
0,
0,
-1, 1.32161, 0, -1, 0.475224,-99) ,
3, 1.29673, 0, 0, 0.498989,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.417616,-99) ,
4, 9.80004, 1, 0, 0.495922,-99) );
// itree = 79
fBoostWeights.push_back(0.0484227);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.999924, 1, 1, 0.514199,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509803,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.385617,-99) ,
8, 1.58796, 0, 0, 0.48735,-99) ,
12, 2.16808, 0, 0, 0.498981,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.407582,-99) ,
5, 0.995715, 0, 0, 0.496673,-99) );
// itree = 80
fBoostWeights.push_back(0.0303254);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.555795,-99) ,
NN(
0,
0,
-1, 0.25298, 1, -1, 0.490191,-99) ,
3, 2.5715, 0, 0, 0.493907,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.414859,-99) ,
4, 9.79756, 1, 0, 0.490923,-99) );
// itree = 81
fBoostWeights.push_back(0.0269096);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.542562,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498485,-99) ,
3, 2.36082, 0, 0, 0.502919,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.439531,-99) ,
0, 0.490516, 0, 0, 0.499572,-99) ,
NN(
0,
0,
-1, 0.505346, 1, -1, 0.453482,-99) ,
0, 0.502852, 1, 0, 0.493612,-99) );
// itree = 82
fBoostWeights.push_back(0.0363675);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522186,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49615,-99) ,
6, -0.191228, 1, 0, 0.507372,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.421089,-99) ,
0, 0.489519, 0, 0, 0.504368,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51186,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470451,-99) ,
2, 0.0723943, 0, 0, 0.479226,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.430095,-99) ,
0, 0.506027, 1, 0, 0.47384,-99) ,
0, 0.500947, 1, 0, 0.49683,-99) );
// itree = 83
fBoostWeights.push_back(0.0246921);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.09347, 0, 1, 0.506374,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.430732,-99) ,
0, 0.489791, 0, 0, 0.50365,-99) ,
NN(
0,
0,
-1, 0.50512, 1, -1, 0.462769,-99) ,
0, 0.502852, 1, 0, 0.498354,-99) );
// itree = 84
fBoostWeights.push_back(0.0650852);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.602803,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459138,-99) ,
11, -1.11924, 1, 0, 0.564985,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.550554,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.40329,-99) ,
12, -0.0280001, 0, 0, 0.477387,-99) ,
9, -951.286, 1, 0, 0.52655,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.551514,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490765,-99) ,
8, 1.9027, 0, 0, 0.498068,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503265,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.420864,-99) ,
9, -951.216, 0, 0, 0.450442,-99) ,
6, 0.138909, 1, 0, 0.489338,-99) ,
3, 2.07881, 0, 0, 0.49639,-99) );
// itree = 85
fBoostWeights.push_back(0.0588536);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.61235, 1, 1, 0.547058,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509276,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460833,-99) ,
6, 0.0512965, 1, 0, 0.498613,-99) ,
3, 2.0788, 0, 0, 0.504836,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.576304,-99) ,
NN(
0,
0,
-1, -0.58422, 0, -1, 0.408198,-99) ,
11, -2.82139, 1, 0, 0.462523,-99) ,
12, -0.118879, 0, 0, 0.498811,-99) );
// itree = 86
fBoostWeights.push_back(0.0220699);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534665,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498986,-99) ,
7, 0.0113341, 0, 0, 0.504134,-99) ,
NN(
0,
0,
-1, -0.465791, 1, -1, 0.449831,-99) ,
7, 0.0238027, 1, 0, 0.500741,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.428104,-99) ,
4, 9.79252, 1, 0, 0.497991,-99) );
// itree = 87
fBoostWeights.push_back(0.0372888);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.560236,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497024,-99) ,
11, 1.02599, 0, 0, 0.508939,-99) ,
NN(
0,
0,
-1, 2.79705, 0, -1, 0.474829,-99) ,
3, 1.13738, 0, 0, 0.502095,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500277,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.371778,-99) ,
6, -0.465871, 1, 0, 0.442285,-99) ,
7, 0.0237992, 1, 0, 0.498419,-99) );
// itree = 88
fBoostWeights.push_back(0.0338587);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.351518, 1, 1, 0.512506,-99) ,
NN(
0,
0,
-1, -0.481305, 1, -1, 0.478341,-99) ,
3, 1.1236, 0, 0, 0.505852,-99) ,
NN(
0,
0,
-1, -0.465871, 1, -1, 0.442945,-99) ,
7, 0.0238027, 1, 0, 0.501978,-99) );
// itree = 89
fBoostWeights.push_back(0.0412935);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512999,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459354,-99) ,
7, 0.0237903, 1, 0, 0.509733,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.444247,-99) ,
0, 0.490154, 0, 0, 0.506399,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537487,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479916,-99) ,
12, 3.79781, 1, 0, 0.49855,-99) ,
NN(
0,
0,
-1, 1.68786, 0, -1, 0.463425,-99) ,
11, 1.06847, 0, 0, 0.476214,-99) ,
0, 0.500947, 1, 0, 0.499044,-99) );
// itree = 90
fBoostWeights.push_back(0.0336257);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.56609,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521688,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491865,-99) ,
7, 0.00793309, 0, 0, 0.499771,-99) ,
NN(
0,
0,
-1, 0.498091, 1, -1, 0.427538,-99) ,
7, 0.0238014, 1, 0, 0.495888,-99) ,
6, -0.820146, 1, 0, 0.49838,-99) );
// itree = 91
fBoostWeights.push_back(0.0489846);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536991,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484706,-99) ,
6, 0.338737, 1, 0, 0.515938,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504286,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.404145,-99) ,
12, 1.10432, 0, 0, 0.48875,-99) ,
3, 1.61542, 0, 0, 0.500671,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.438832,-99) ,
10, 1.85708, 1, 0, 0.497932,-99) );
// itree = 92
fBoostWeights.push_back(0.0307676);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -2.94586, 1, 1, 0.508999,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501945,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.377598,-99) ,
12, 1.44727, 0, 0, 0.483746,-99) ,
3, 1.44168, 0, 0, 0.498002,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.416041,-99) ,
10, 2.1428, 1, 0, 0.495934,-99) );
// itree = 93
fBoostWeights.push_back(0.0313787);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.581745,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47219,-99) ,
9, -951.286, 1, 0, 0.530914,-99) ,
NN(
0,
0,
-1, 0.997619, 0, -1, 0.488721,-99) ,
3, 2.37077, 0, 0, 0.492812,-99) );
// itree = 94
fBoostWeights.push_back(0.0466962);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522265,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466536,-99) ,
10, 1.00003, 1, 0, 0.51099,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501463,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.373828,-99) ,
12, 1.32977, 0, 0, 0.484971,-99) ,
3, 1.44166, 0, 0, 0.49979,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.436672,-99) ,
4, 9.36329, 1, 0, 0.49708,-99) );
// itree = 95
fBoostWeights.push_back(0.0462401);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.311433, 1, 1, 0.554411,-99) ,
NN(
0,
0,
-1, 1.85713, 1, -1, 0.49237,-99) ,
6, -0.161076, 1, 0, 0.502565,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.56258,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48798,-99) ,
10, -1.28584, 1, 0, 0.496757,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.325479,-99) ,
12, 1.32161, 0, 0, 0.478302,-99) ,
8, 1.55213, 0, 0, 0.492887,-99) );
// itree = 96
fBoostWeights.push_back(0.0405883);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.61204, 1, 1, 0.511376,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.41607,-99) ,
10, 1.85711, 1, 0, 0.506089,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506024,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.458859,-99) ,
6, -0.36938, 1, 0, 0.490814,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.374321,-99) ,
12, 0.991719, 0, 0, 0.480463,-99) ,
3, 1.43112, 0, 0, 0.495278,-99) );
// itree = 97
fBoostWeights.push_back(0.0252692);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.605013,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499168,-99) ,
11, -2.98434, 1, 0, 0.504014,-99) ,
NN(
0,
0,
-1, 2.79705, 0, -1, 0.47277,-99) ,
3, 1.1374, 0, 0, 0.49768,-99) ,
NN(
0,
0,
-1, -0.466946, 1, -1, 0.446984,-99) ,
7, 0.0237992, 1, 0, 0.494562,-99) );
// itree = 98
fBoostWeights.push_back(0.0266042);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.555681,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503386,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.420806,-99) ,
5, 0.998572, 0, 0, 0.499258,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505923,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.420761,-99) ,
5, 0.999524, 1, 0, 0.455267,-99) ,
6, 0.436968, 1, 0, 0.494822,-99) ,
3, 2.68748, 0, 0, 0.497372,-99) );
// itree = 99
fBoostWeights.push_back(0.0279943);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -2.99548, 1, 1, 0.505952,-99) ,
NN(
0,
0,
-1, -0.519248, 1, -1, 0.468899,-99) ,
3, 1.13738, 0, 0, 0.498458,-99) ,
NN(
0,
0,
-1, -0.467165, 1, -1, 0.440617,-99) ,
7, 0.0237992, 1, 0, 0.494923,-99) );
// itree = 100
fBoostWeights.push_back(0.0535254);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.575586,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459288,-99) ,
10, 1.00032, 1, 0, 0.545699,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53694,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.406033,-99) ,
12, -0.0108776, 0, 0, 0.471272,-99) ,
9, -12.1436, 1, 0, 0.512851,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502755,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47079,-99) ,
10, 0.714336, 1, 0, 0.493378,-99) ,
NN(
0,
0,
-1, 1.6882, 0, -1, 0.458849,-99) ,
12, 0.863138, 0, 0, 0.485789,-99) ,
3, 2.06945, 0, 0, 0.49104,-99) );
// itree = 101
fBoostWeights.push_back(0.0411795);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.546135,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.540464,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487483,-99) ,
3, 1.97346, 0, 0, 0.493572,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500571,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.434507,-99) ,
5, 0.999524, 1, 0, 0.458955,-99) ,
6, 0.347273, 1, 0, 0.488447,-99) ,
3, 2.71031, 0, 0, 0.490699,-99) );
// itree = 102
fBoostWeights.push_back(0.0238943);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.374967, 1, 1, 0.506292,-99) ,
NN(
0,
0,
-1, 1.63552, 0, -1, 0.483202,-99) ,
3, 1.28125, 0, 0, 0.499046,-99) ,
NN(
0,
0,
-1, -0.101615, 1, -1, 0.450355,-99) ,
0, 0.504757, 1, 0, 0.496182,-99) );
// itree = 103
fBoostWeights.push_back(0.0184668);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.558875,-99) ,
NN(
0,
0,
-1, 0.0237973, 1, -1, 0.494764,-99) ,
6, -0.819612, 1, 0, 0.497153,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.42289,-99) ,
5, 0.99619, 0, 0, 0.495031,-99) );
// itree = 104
fBoostWeights.push_back(0.0262905);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.998983, 1, 1, 0.511832,-99) ,
NN(
0,
0,
-1, 1.36875, 0, -1, 0.488866,-99) ,
12, 2.35915, 0, 0, 0.498156,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.427567,-99) ,
5, 0.996191, 0, 0, 0.496159,-99) );
// itree = 105
fBoostWeights.push_back(0.0237402);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -2.9514, 1, 1, 0.506778,-99) ,
NN(
0,
0,
-1, 1.44387, 0, -1, 0.482565,-99) ,
3, 1.27949, 0, 0, 0.498912,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.432966,-99) ,
5, 0.996191, 0, 0, 0.497022,-99) );
// itree = 106
fBoostWeights.push_back(0.0287912);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.551966,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.578852,-99) ,
NN(
0,
0,
-1, 0.531453, 0, -1, 0.489962,-99) ,
11, -2.89037, 1, 0, 0.493787,-99) ,
6, -0.819847, 1, 0, 0.495867,-99) );
// itree = 107
fBoostWeights.push_back(0.0463471);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.630844,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5242,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489002,-99) ,
12, 3.55114, 1, 0, 0.504513,-99) ,
10, -1.28562, 1, 0, 0.512505,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.602863,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494831,-99) ,
10, -1.8604, 1, 0, 0.500666,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.336789,-99) ,
8, 1.43844, 0, 0, 0.487838,-99) ,
12, 1.95822, 0, 0, 0.499268,-99) );
// itree = 108
fBoostWeights.push_back(0.0342473);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528512,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496127,-99) ,
3, 1.64957, 0, 0, 0.506891,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538852,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.452936,-99) ,
5, 0.999456, 1, 0, 0.478098,-99) ,
6, 0.433392, 1, 0, 0.503457,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.443008,-99) ,
5, 0.996191, 0, 0, 0.501738,-99) );
// itree = 109
fBoostWeights.push_back(0.0574347);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.03651, 0, 1, 0.518408,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514696,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467903,-99) ,
6, -0.00903108, 1, 0, 0.491392,-99) ,
10, 0.714244, 1, 0, 0.51011,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.615389,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466345,-99) ,
9, -12.1436, 1, 0, 0.546514,-99) ,
NN(
0,
0,
-1, -0.42274, 0, -1, 0.447705,-99) ,
11, -2.47841, 1, 0, 0.483095,-99) ,
12, 0.301516, 0, 0, 0.504402,-99) );
// itree = 110
fBoostWeights.push_back(0.0252907);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.75171, 0, 1, 0.545234,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516558,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49491,-99) ,
6, -0.370929, 1, 0, 0.501732,-99) ,
3, 2.51546, 0, 0, 0.504581,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.452367,-99) ,
4, 9.36896, 1, 0, 0.502372,-99) );
// itree = 111
fBoostWeights.push_back(0.0520089);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.588272,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499738,-99) ,
11, -1.43045, 1, 0, 0.55641,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.540496,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.428173,-99) ,
12, -0.110271, 0, 0, 0.487488,-99) ,
9, -949.96, 1, 0, 0.526023,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.532471,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495683,-99) ,
3, 1.10699, 0, 0, 0.514759,-99) ,
NN(
0,
0,
-1, 1.42925, 0, -1, 0.480413,-99) ,
11, 0.565681, 0, 0, 0.498142,-99) ,
3, 2.09346, 0, 0, 0.503252,-99) );
// itree = 112
fBoostWeights.push_back(0.0322112);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5599,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509692,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472095,-99) ,
7, 0.00113341, 0, 0, 0.504809,-99) ,
NN(
0,
0,
-1, 0.498089, 1, -1, 0.44242,-99) ,
7, 0.0238027, 1, 0, 0.501505,-99) ,
6, -0.819847, 1, 0, 0.503603,-99) );
// itree = 113
fBoostWeights.push_back(0.0281481);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -2.96722, 1, 1, 0.511911,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502512,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.417655,-99) ,
12, 1.4006, 0, 0, 0.490494,-99) ,
3, 1.4561, 0, 0, 0.502451,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.451672,-99) ,
4, 9.79252, 1, 0, 0.500572,-99) );
// itree = 114
fBoostWeights.push_back(0.0466682);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.664104,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.563049,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4399,-99) ,
11, -2.84868, 1, 0, 0.487582,-99) ,
12, -0.209868, 0, 0, 0.530377,-99) ,
NN(
NN(
0,
0,
-1, 0.669432, 0, 1, 0.535841,-99) ,
NN(
0,
0,
-1, 0.394437, 0, -1, 0.489604,-99) ,
12, 9.49276, 0, 0, 0.4934,-99) ,
11, -1.91133, 1, 0, 0.498835,-99) );
// itree = 115
fBoostWeights.push_back(0.053088);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.602926,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5214,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.440892,-99) ,
11, -1.75443, 1, 0, 0.49763,-99) ,
12, 0.558986, 0, 0, 0.517863,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516309,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486434,-99) ,
6, -0.370929, 1, 0, 0.498933,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.394172,-99) ,
12, 0.670905, 0, 0, 0.494872,-99) ,
11, -1.0324, 1, 0, 0.50171,-99) );
// itree = 116
fBoostWeights.push_back(0.0516507);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.780039, 0, 1, 0.558656,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509553,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469272,-99) ,
12, -0.276155, 0, 0, 0.50229,-99) ,
6, -0.316457, 1, 0, 0.509297,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.574666,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479772,-99) ,
10, -0.714383, 1, 0, 0.499378,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.393493,-99) ,
11, 2.44804, 0, 0, 0.481186,-99) ,
8, 1.34175, 0, 0, 0.501759,-99) );
// itree = 117
fBoostWeights.push_back(0.0334434);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.551006,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457151,-99) ,
3, 0.962943, 0, 0, 0.526084,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.550517,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495155,-99) ,
12, 8.24568, 0, 0, 0.498054,-99) ,
7, 0.0102002, 0, 0, 0.503024,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506732,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.398169,-99) ,
6, -0.466358, 1, 0, 0.458038,-99) ,
7, 0.0238014, 1, 0, 0.500306,-99) );
// itree = 118
fBoostWeights.push_back(0.0374379);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.57119, 1, 1, 0.514755,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510535,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460015,-99) ,
11, 1.84984, 0, 0, 0.492165,-99) ,
3, 1.44166, 0, 0, 0.505019,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454439,-99) ,
4, 9.42256, 1, 0, 0.502927,-99) );
// itree = 119
fBoostWeights.push_back(0.026737);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.5712, 1, 1, 0.509628,-99) ,
NN(
0,
0,
-1, 1.194, 0, -1, 0.486141,-99) ,
8, 1.55213, 0, 0, 0.500703,-99) ,
NN(
0,
0,
-1, -0.463839, 1, -1, 0.454111,-99) ,
7, 0.0238014, 1, 0, 0.49784,-99) );
// itree = 120
fBoostWeights.push_back(0.0319259);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.20926, 0, 1, 0.506551,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529548,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.415655,-99) ,
11, -2.39764, 1, 0, 0.477285,-99) ,
12, -0.0532287, 0, 0, 0.501991,-99) ,
NN(
0,
0,
-1, 1.08681, 1, -1, 0.455085,-99) ,
7, 0.0237902, 1, 0, 0.499094,-99) );
// itree = 121
fBoostWeights.push_back(0.0308465);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529432,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496471,-99) ,
11, -0.91795, 1, 0, 0.504397,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.419142,-99) ,
5, 0.998096, 0, 0, 0.501716,-99) ,
NN(
0,
0,
-1, 0.999524, 1, -1, 0.461383,-99) ,
6, 0.43872, 1, 0, 0.496528,-99) );
// itree = 122
fBoostWeights.push_back(0.0479872);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.74155, 1, 1, 0.544296,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505581,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.448547,-99) ,
12, 1.21349, 0, 0, 0.495993,-99) ,
8, 1.85522, 0, 0, 0.505354,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.566736,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479295,-99) ,
9, -951.286, 0, 0, 0.516228,-99) ,
NN(
0,
0,
-1, 2.42374, 0, -1, 0.466871,-99) ,
5, 0.999524, 1, 0, 0.482459,-99) ,
6, 0.170465, 1, 0, 0.498684,-99) );
// itree = 123
fBoostWeights.push_back(0.0469963);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.23269, 1, 1, 0.551896,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508442,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475529,-99) ,
10, 0.428484, 1, 0, 0.496452,-99) ,
3, 2.2528, 0, 0, 0.500329,-99) ,
NN(
NN(
0,
0,
-1, -1.21194, 1, 1, 0.53971,-99) ,
NN(
0,
0,
-1, -0.480251, 0, -1, 0.437398,-99) ,
11, -2.59247, 1, 0, 0.474752,-99) ,
12, 0.0997583, 0, 0, 0.495829,-99) );
// itree = 124
fBoostWeights.push_back(0.0326491);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.609748,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490143,-99) ,
12, 0.400969, 0, 0, 0.514139,-99) ,
NN(
0,
0,
-1, 0.557198, 0, -1, 0.490909,-99) ,
11, -1.22553, 1, 0, 0.497011,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.432989,-99) ,
0, 0.505709, 1, 0, 0.49486,-99) );
// itree = 125
fBoostWeights.push_back(0.0234031);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.85705, 1, 1, 0.506863,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503595,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.419799,-99) ,
11, 3.08541, 0, 0, 0.485695,-99) ,
8, 1.33584, 0, 0, 0.501088,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.444494,-99) ,
5, 0.996191, 0, 0, 0.499501,-99) );
// itree = 126
fBoostWeights.push_back(0.0392061);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.603127,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496077,-99) ,
12, 3.54188, 1, 0, 0.541198,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501772,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.422125,-99) ,
8, 1.48948, 0, 0, 0.494866,-99) ,
11, 1.33765, 0, 0, 0.502091,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.542584,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475673,-99) ,
10, -0.714277, 1, 0, 0.490013,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.389769,-99) ,
12, 3.14509, 0, 0, 0.47747,-99) ,
3, 1.13152, 0, 0, 0.496625,-99) );
// itree = 127
fBoostWeights.push_back(0.0244408);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517568,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495909,-99) ,
11, -1.22553, 1, 0, 0.501615,-99) ,
NN(
0,
0,
-1, 1.58051, 0, -1, 0.458897,-99) ,
0, 0.50453, 1, 0, 0.49864,-99) ,
NN(
0,
0,
-1, 0.0726185, 1, -1, 0.456853,-99) ,
0, 0.491424, 0, 0, 0.495812,-99) );
// itree = 128
fBoostWeights.push_back(0.0569709);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522431,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480632,-99) ,
5, 0.999955, 0, 0, 0.507381,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445821,-99) ,
5, 0.999049, 0, 0, 0.503952,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.572708,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473027,-99) ,
11, -1.83172, 1, 0, 0.49444,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500659,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.36735,-99) ,
11, -2.72524, 1, 0, 0.44537,-99) ,
12, -0.389667, 0, 0, 0.482,-99) ,
6, 0.170879, 1, 0, 0.497618,-99) );
// itree = 129
fBoostWeights.push_back(0.0337422);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511156,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489315,-99) ,
0, 0.499042, 1, 0, 0.502193,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.443034,-99) ,
5, 0.998572, 0, 0, 0.49923,-99) ,
NN(
NN(
0,
0,
-1, 0.143103, 0, 1, 0.513618,-99) ,
NN(
0,
0,
-1, 0.0482228, 0, -1, 0.440193,-99) ,
5, 0.999524, 1, 0, 0.46956,-99) ,
6, 0.441077, 1, 0, 0.495426,-99) );
// itree = 130
fBoostWeights.push_back(0.0494477);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.512543, 1, 1, 0.529672,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50619,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47867,-99) ,
6, -0.234816, 1, 0, 0.494769,-99) ,
3, 1.90147, 0, 0, 0.500822,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.550469,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.449118,-99) ,
12, -0.620382, 0, 0, 0.497647,-99) ,
NN(
0,
0,
-1, -1.07571, 1, -1, 0.414588,-99) ,
11, -1.88962, 1, 0, 0.472978,-99) ,
12, 0.26054, 0, 0, 0.495168,-99) );
// itree = 131
fBoostWeights.push_back(0.0242969);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.577403,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49887,-99) ,
6, -0.396981, 1, 0, 0.504447,-99) ,
NN(
0,
0,
-1, 3.26991, 0, -1, 0.480958,-99) ,
8, 1.3361, 0, 0, 0.498204,-99) ,
NN(
0,
0,
-1, 1.37644, 0, -1, 0.456588,-99) ,
0, 0.491424, 0, 0, 0.495378,-99) );
// itree = 132
fBoostWeights.push_back(0.0248837);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.38308, 1, 1, 0.506207,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500517,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.421072,-99) ,
11, 3.07778, 0, 0, 0.483454,-99) ,
8, 1.33624, 0, 0, 0.500195,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518254,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466258,-99) ,
5, 0.999955, 0, 0, 0.490872,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.418347,-99) ,
5, 0.999524, 0, 0, 0.469212,-99) ,
0, 0.492376, 0, 0, 0.497179,-99) );
// itree = 133
fBoostWeights.push_back(0.0387766);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.633892,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534478,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.42013,-99) ,
8, 1.45129, 0, 0, 0.476916,-99) ,
9, -951.265, 0, 0, 0.517722,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500575,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466466,-99) ,
3, 0.967169, 0, 0, 0.495181,-99) ,
NN(
0,
0,
-1, -2.49593, 1, -1, 0.442177,-99) ,
12, -0.280254, 0, 0, 0.490953,-99) ,
10, -1.28572, 1, 0, 0.494709,-99) );
// itree = 134
fBoostWeights.push_back(0.0290506);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.577755,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465539,-99) ,
8, 1.45937, 0, 0, 0.520231,-99) ,
NN(
0,
0,
-1, -0.518331, 0, -1, 0.489637,-99) ,
10, -1.57138, 1, 0, 0.492452,-99) );
// itree = 135
fBoostWeights.push_back(0.0500908);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.578168,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496516,-99) ,
10, 0.553802, 1, 0, 0.524958,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510802,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.482964,-99) ,
11, 1.4669, 0, 0, 0.495044,-99) ,
3, 2.04929, 0, 0, 0.499013,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.589453,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457041,-99) ,
12, -1.0496, 0, 0, 0.520681,-99) ,
NN(
0,
0,
-1, -0.683215, 1, -1, 0.422339,-99) ,
11, -2.49364, 1, 0, 0.468746,-99) ,
12, -0.0224326, 0, 0, 0.494278,-99) );
// itree = 136
fBoostWeights.push_back(0.0430363);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.68186, 1, 1, 0.509221,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.55623,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.390234,-99) ,
11, -2.99413, 1, 0, 0.459215,-99) ,
12, -0.585612, 0, 0, 0.503987,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.552809,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490964,-99) ,
10, -0.716135, 1, 0, 0.506865,-99) ,
NN(
0,
0,
-1, 3.24846, 0, -1, 0.446537,-99) ,
6, -0.626121, 1, 0, 0.479081,-99) ,
3, 1.13738, 0, 0, 0.498377,-99) );
// itree = 137
fBoostWeights.push_back(0.0406943);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.627059,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494439,-99) ,
11, -1.66616, 1, 0, 0.511838,-99) ,
NN(
0,
0,
-1, 1.5788, 0, -1, 0.489623,-99) ,
3, 1.61545, 0, 0, 0.497741,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.549982,-99) ,
NN(
0,
0,
-1, -0.720669, 0, -1, 0.448776,-99) ,
11, -2.93765, 1, 0, 0.47231,-99) ,
12, 0.0157684, 0, 0, 0.493633,-99) );
// itree = 138
fBoostWeights.push_back(0.0217897);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.857, 1, 1, 0.505786,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502885,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.419449,-99) ,
11, 3.34521, 0, 0, 0.484316,-99) ,
8, 1.31066, 0, 0, 0.500896,-99) ,
NN(
0,
0,
-1, -0.467577, 1, -1, 0.461367,-99) ,
7, 0.0237992, 1, 0, 0.498449,-99) );
// itree = 139
fBoostWeights.push_back(0.0184445);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.77676, 0, 1, 0.521762,-99) ,
NN(
0,
0,
-1, -0.321964, 0, -1, 0.494651,-99) ,
10, -1.28572, 1, 0, 0.498425,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.449173,-99) ,
4, 9.78684, 1, 0, 0.496615,-99) );
// itree = 140
fBoostWeights.push_back(0.044802);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.575664,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492103,-99) ,
10, 1.00718, 1, 0, 0.534544,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517618,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493819,-99) ,
6, -0.474363, 1, 0, 0.50108,-99) ,
3, 2.05719, 0, 0, 0.504917,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.586025,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465002,-99) ,
12, -0.862346, 0, 0, 0.520018,-99) ,
NN(
0,
0,
-1, -0.368596, 1, -1, 0.441621,-99) ,
11, -2.29908, 1, 0, 0.478924,-99) ,
12, 0.239737, 0, 0, 0.49972,-99) );
// itree = 141
fBoostWeights.push_back(0.0361989);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.24315, 1, 1, 0.513023,-99) ,
NN(
0,
0,
-1, 0.999671, 0, -1, 0.487181,-99) ,
8, 1.30007, 0, 0, 0.50514,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.55918,-99) ,
NN(
0,
0,
-1, -0.739483, 0, -1, 0.465713,-99) ,
11, -2.97522, 1, 0, 0.482072,-99) ,
12, 0.239737, 0, 0, 0.500532,-99) );
// itree = 142
fBoostWeights.push_back(0.0226094);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.28568, 1, 1, 0.506682,-99) ,
NN(
0,
0,
-1, 0.241581, 0, -1, 0.461804,-99) ,
5, 0.998572, 0, 0, 0.504109,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512553,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.436971,-99) ,
5, 0.999524, 1, 0, 0.469545,-99) ,
6, 0.531162, 1, 0, 0.501143,-99) );
// itree = 143
fBoostWeights.push_back(0.026313);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.582653,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471152,-99) ,
8, 1.48867, 0, 0, 0.522859,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501903,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477018,-99) ,
3, 0.978056, 0, 0, 0.498027,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.420685,-99) ,
12, -0.649415, 0, 0, 0.494007,-99) ,
10, -1.57143, 1, 0, 0.496659,-99) );
// itree = 144
fBoostWeights.push_back(0.0354595);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.628845,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.556699,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.443196,-99) ,
8, 1.68671, 0, 0, 0.476954,-99) ,
9, -949.657, 0, 0, 0.516897,-99) ,
NN(
0,
0,
-1, -0.506761, 0, -1, 0.49157,-99) ,
10, -1.28573, 1, 0, 0.495067,-99) );
// itree = 145
fBoostWeights.push_back(0.026706);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.278566, 1, 1, 0.543854,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504121,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.448939,-99) ,
5, 0.998572, 0, 0, 0.501508,-99) ,
3, 2.17613, 0, 0, 0.504803,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523413,-99) ,
NN(
0,
0,
-1, -951.218, 1, -1, 0.451689,-99) ,
5, 0.999048, 1, 0, 0.473319,-99) ,
6, 0.437732, 1, 0, 0.500724,-99) );
// itree = 146
fBoostWeights.push_back(0.0150812);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.567201,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495599,-99) ,
3, 0.640823, 0, 0, 0.530211,-99) ,
NN(
0,
0,
-1, 0.0238027, 1, -1, 0.494333,-99) ,
12, 9.98416, 0, 0, 0.496644,-99) );
// itree = 147
fBoostWeights.push_back(0.0179765);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.54144,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53209,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497687,-99) ,
12, 9.64884, 0, 0, 0.500441,-99) ,
3, 2.37891, 0, 0, 0.502581,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501094,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.441614,-99) ,
5, 0.999524, 1, 0, 0.466903,-99) ,
6, 0.52689, 1, 0, 0.499491,-99) );
// itree = 148
fBoostWeights.push_back(0.0392692);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.48105, 1, 1, 0.516915,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505999,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460573,-99) ,
12, 1.62623, 0, 0, 0.497124,-99) ,
3, 1.60516, 0, 0, 0.504436,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.550607,-99) ,
NN(
0,
0,
-1, -0.741508, 0, -1, 0.453391,-99) ,
11, -2.96087, 1, 0, 0.474991,-99) ,
12, 0.04107, 0, 0, 0.499602,-99) );
// itree = 149
fBoostWeights.push_back(0.019948);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.578714,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485644,-99) ,
8, 1.45129, 0, 0, 0.531574,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50092,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445346,-99) ,
10, 2.12919, 1, 0, 0.49927,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.424989,-99) ,
12, -0.649978, 0, 0, 0.495382,-99) ,
10, -1.57143, 1, 0, 0.498712,-99) );
// itree = 150
fBoostWeights.push_back(0.0444976);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.624499,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.542576,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.446065,-99) ,
13, 1.56744, 0, 0, 0.482481,-99) ,
9, -951.236, 0, 0, 0.518976,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512696,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489394,-99) ,
8, 1.97301, 0, 0, 0.496435,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517382,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.403217,-99) ,
11, -2.60323, 1, 0, 0.460985,-99) ,
12, -0.274282, 0, 0, 0.493627,-99) ,
10, -1.2857, 1, 0, 0.497099,-99) );
// itree = 151
fBoostWeights.push_back(0.0253393);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.01568, 0, 1, 0.524494,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534092,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494452,-99) ,
3, 2.31037, 0, 0, 0.496504,-99) ,
10, -1.28573, 1, 0, 0.500606,-99) ,
NN(
NN(
0,
0,
-1, 0.144554, 0, 1, 0.505444,-99) ,
NN(
0,
0,
-1, 2.42094, 0, -1, 0.44799,-99) ,
5, 0.999524, 1, 0, 0.470869,-99) ,
6, 0.441077, 1, 0, 0.49677,-99) );
// itree = 152
fBoostWeights.push_back(0.0265729);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.57145, 1, 1, 0.50588,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.450521,-99) ,
5, 0.998572, 0, 0, 0.503528,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.547149,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473769,-99) ,
10, -0.0241, 1, 0, 0.492621,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.436559,-99) ,
12, -0.596316, 0, 0, 0.479145,-99) ,
6, 0.351011, 1, 0, 0.499235,-99) );
// itree = 153
fBoostWeights.push_back(0.00997516);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.73084, 0, 1, 0.501554,-99) ,
NN(
0,
0,
-1, -0.0993513, 1, -1, 0.466842,-99) ,
0, 0.491061, 0, 0, 0.499483,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.451672,-99) ,
0, 0.505709, 1, 0, 0.497834,-99) );
// itree = 154
fBoostWeights.push_back(0.037046);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.159313, 1, 1, 0.514935,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50138,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.428217,-99) ,
12, 1.34608, 0, 0, 0.490756,-99) ,
8, 1.68143, 0, 0, 0.499612,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541945,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471631,-99) ,
10, -0.139633, 1, 0, 0.487489,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44216,-99) ,
12, -0.581195, 0, 0, 0.477404,-99) ,
6, 0.258147, 1, 0, 0.494449,-99) );
// itree = 155
fBoostWeights.push_back(0.023291);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.585981,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465418,-99) ,
3, 1.25533, 0, 0, 0.529015,-99) ,
NN(
0,
0,
-1, -0.921053, 0, -1, 0.49277,-99) ,
10, -1.85713, 1, 0, 0.494852,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.439499,-99) ,
0, 0.489519, 0, 0, 0.493433,-99) );
// itree = 156
fBoostWeights.push_back(0.0390734);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.618371,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.543723,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.443732,-99) ,
13, 1.56744, 0, 0, 0.482021,-99) ,
9, -949.657, 0, 0, 0.516886,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.546707,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492103,-99) ,
3, 2.5715, 0, 0, 0.494237,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454228,-99) ,
12, -0.411339, 0, 0, 0.491726,-99) ,
10, -1.28572, 1, 0, 0.49519,-99) );
// itree = 157
fBoostWeights.push_back(0.0190899);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.595272,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475818,-99) ,
3, 1.24104, 0, 0, 0.540698,-99) ,
NN(
NN(
0,
0,
-1, 9.47975, 0, 1, 0.502982,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.416722,-99) ,
12, -0.892114, 0, 0, 0.499498,-99) ,
10, -1.85716, 1, 0, 0.501914,-99) );
// itree = 158
fBoostWeights.push_back(0.0291088);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.592351,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475025,-99) ,
8, 1.43511, 0, 0, 0.529665,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509238,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490445,-99) ,
10, -0.00681088, 1, 0, 0.499087,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.436762,-99) ,
12, -0.789969, 0, 0, 0.496096,-99) ,
10, -1.85714, 1, 0, 0.498032,-99) );
// itree = 159
fBoostWeights.push_back(0.0201886);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541408,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503336,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483271,-99) ,
8, 1.23761, 0, 0, 0.498568,-99) ,
NN(
0,
0,
-1, 0.999524, 1, -1, 0.457201,-99) ,
6, 0.526804, 1, 0, 0.495959,-99) ,
3, 2.69723, 0, 0, 0.497753,-99) );
// itree = 160
fBoostWeights.push_back(0.042039);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.583319,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484251,-99) ,
12, 1.64651, 0, 0, 0.528559,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510396,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491641,-99) ,
3, 1.58772, 0, 0, 0.499451,-99) ,
10, -1.28572, 1, 0, 0.502172,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.581143,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455257,-99) ,
12, -0.938151, 0, 0, 0.515189,-99) ,
NN(
0,
0,
-1, -0.711458, 1, -1, 0.43767,-99) ,
11, -2.35299, 1, 0, 0.477646,-99) ,
12, 0.0623895, 0, 0, 0.498033,-99) );
// itree = 161
fBoostWeights.push_back(0.0343031);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.88837, 0, 1, 0.506525,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.452651,-99) ,
10, 2.1428, 1, 0, 0.504783,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536961,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45462,-99) ,
9, -12.1436, 1, 0, 0.500776,-99) ,
NN(
0,
0,
-1, -0.818877, 1, -1, 0.426629,-99) ,
11, -1.74638, 1, 0, 0.480474,-99) ,
12, 0.379125, 0, 0, 0.499371,-99) );
// itree = 162
fBoostWeights.push_back(0.0276049);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.565667,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487489,-99) ,
8, 1.45166, 0, 0, 0.526443,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526926,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493049,-99) ,
3, 2.41215, 0, 0, 0.495262,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.440754,-99) ,
12, -0.580026, 0, 0, 0.492058,-99) ,
10, -1.57145, 1, 0, 0.495213,-99) );
// itree = 163
fBoostWeights.push_back(0.0363383);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.57634,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509985,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481588,-99) ,
3, 0.946099, 0, 0, 0.50278,-99) ,
10, -1.28569, 1, 0, 0.507402,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.576699,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490902,-99) ,
10, -1.88125, 1, 0, 0.495708,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.374779,-99) ,
8, 1.42167, 0, 0, 0.487893,-99) ,
12, 1.79305, 0, 0, 0.497601,-99) );
// itree = 164
fBoostWeights.push_back(0.024103);
fForest.push_back(
NN(
NN(
0,
0,
-1, -0.811333, 1, 1, 0.540004,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5278,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495192,-99) ,
7, 0.0113343, 0, 0, 0.499405,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.444356,-99) ,
7, 0.0238027, 1, 0, 0.496734,-99) ,
12, 9.88145, 0, 0, 0.499552,-99) );
// itree = 165
fBoostWeights.push_back(0.0251428);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.580082,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498613,-99) ,
8, 0.727711, 0, 0, 0.534732,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505782,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.458255,-99) ,
3, 0.974822, 0, 0, 0.502344,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.440992,-99) ,
7, 0.0237973, 1, 0, 0.499461,-99) ,
12, 9.49449, 0, 0, 0.501958,-99) );
// itree = 166
fBoostWeights.push_back(0.0234784);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.565463,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495828,-99) ,
3, 0.640814, 0, 0, 0.530124,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523606,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494882,-99) ,
11, -1.96763, 1, 0, 0.499205,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44576,-99) ,
7, 0.0237973, 1, 0, 0.496622,-99) ,
12, 9.88145, 0, 0, 0.498832,-99) );
// itree = 167
fBoostWeights.push_back(0.0287025);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.74446, 0, 1, 0.53596,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536686,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495636,-99) ,
11, 1.56047, 0, 0, 0.502204,-99) ,
NN(
0,
0,
-1, 4.96002, 0, -1, 0.464465,-99) ,
8, 1.17557, 0, 0, 0.497871,-99) ,
12, 8.96386, 0, 0, 0.500838,-99) );
// itree = 168
fBoostWeights.push_back(0.0233395);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.546601,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506675,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457057,-99) ,
3, 0.818714, 0, 0, 0.504288,-99) ,
NN(
0,
0,
-1, 0.498091, 1, -1, 0.45463,-99) ,
7, 0.0238027, 1, 0, 0.501649,-99) ,
6, -0.820776, 1, 0, 0.503243,-99) );
// itree = 169
fBoostWeights.push_back(0.0309175);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.687959, 0, 1, 0.535673,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531763,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493478,-99) ,
11, -1.39093, 1, 0, 0.501643,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445762,-99) ,
12, -1.05429, 0, 0, 0.499168,-99) ,
12, 9.08228, 0, 0, 0.50196,-99) );
// itree = 170
fBoostWeights.push_back(0.037809);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.90658, 0, 1, 0.517214,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525634,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49436,-99) ,
3, 2.21486, 0, 0, 0.498567,-99) ,
10, 0.142801, 1, 0, 0.50755,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.578548,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473796,-99) ,
12, -1.19501, 0, 0, 0.531516,-99) ,
NN(
0,
0,
-1, -0.490183, 0, -1, 0.460692,-99) ,
11, -2.55663, 1, 0, 0.484913,-99) ,
12, 0.222023, 0, 0, 0.503114,-99) );
// itree = 171
fBoostWeights.push_back(0.0188881);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.73084, 0, 1, 0.507196,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471783,-99) ,
0, 0.505029, 1, 0, 0.505353,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.447717,-99) ,
0, 0.489519, 0, 0, 0.503843,-99) );
// itree = 172
fBoostWeights.push_back(0.019373);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.581863,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475477,-99) ,
3, 1.2363, 0, 0, 0.533999,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502916,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44329,-99) ,
12, -0.761033, 0, 0, 0.49992,-99) ,
10, -1.85716, 1, 0, 0.501887,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.447492,-99) ,
0, 0.489519, 0, 0, 0.500458,-99) );
// itree = 173
fBoostWeights.push_back(0.0294776);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.498089, 1, 1, 0.530435,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520116,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490982,-99) ,
11, 1.08692, 0, 0, 0.4992,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.452819,-99) ,
8, 0.951397, 0, 0, 0.497194,-99) ,
12, 9.99987, 0, 0, 0.499317,-99) );
// itree = 174
fBoostWeights.push_back(0.0168361);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.584244,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474083,-99) ,
3, 1.25489, 0, 0, 0.532872,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501638,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445654,-99) ,
10, 2.07474, 1, 0, 0.499858,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.450149,-99) ,
12, -0.822162, 0, 0, 0.497584,-99) ,
10, -1.85716, 1, 0, 0.499618,-99) );
// itree = 175
fBoostWeights.push_back(0.0274047);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.498091, 0, 1, 0.55821,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484615,-99) ,
3, 1.2702, 0, 0, 0.525563,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511532,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493507,-99) ,
10, -0.0476422, 1, 0, 0.500956,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.451755,-99) ,
12, -0.515693, 0, 0, 0.497775,-99) ,
10, -1.57142, 1, 0, 0.500308,-99) );
// itree = 176
fBoostWeights.push_back(0.0282794);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511529,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494882,-99) ,
8, 1.5525, 0, 0, 0.504934,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464324,-99) ,
4, 8.99077, 1, 0, 0.503199,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522548,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48897,-99) ,
4, 4.56233, 1, 0, 0.508149,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509117,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471097,-99) ,
2, -0.0781625, 1, 0, 0.480481,-99) ,
2, 0.071474, 0, 0, 0.486185,-99) ,
0, 0.499995, 1, 0, 0.497774,-99) );
// itree = 177
fBoostWeights.push_back(0.0327134);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527676,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.435389,-99) ,
5, 0.99981, 0, 0, 0.514825,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503476,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464707,-99) ,
8, 1.50057, 0, 0, 0.495812,-99) ,
6, -0.461409, 1, 0, 0.500296,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.442834,-99) ,
5, 0.996191, 0, 0, 0.498725,-99) );
// itree = 178
fBoostWeights.push_back(0.0155708);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.576248,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492006,-99) ,
8, 1.4315, 0, 0, 0.531644,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500006,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480911,-99) ,
8, 1.11638, 0, 0, 0.496802,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44005,-99) ,
12, -0.811599, 0, 0, 0.494187,-99) ,
10, -1.85714, 1, 0, 0.496331,-99) );
// itree = 179
fBoostWeights.push_back(0.0378225);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.557833,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491549,-99) ,
5, 0.999986, 0, 0, 0.530937,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459059,-99) ,
5, 0.999905, 0, 0, 0.516256,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516859,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488703,-99) ,
11, -1.67996, 1, 0, 0.494951,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.425199,-99) ,
7, 0.0238027, 1, 0, 0.492341,-99) ,
6, -0.549649, 1, 0, 0.496439,-99) );
// itree = 180
fBoostWeights.push_back(0.0358445);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.588438,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498019,-99) ,
3, 1.20573, 0, 0, 0.534665,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505029,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479534,-99) ,
3, 0.809758, 0, 0, 0.502416,-99) ,
10, -1.28574, 1, 0, 0.505408,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.596356,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463356,-99) ,
12, -0.735703, 0, 0, 0.510832,-99) ,
NN(
0,
0,
-1, -0.669044, 1, -1, 0.442981,-99) ,
11, -2.30723, 1, 0, 0.478298,-99) ,
12, 0.116956, 0, 0, 0.500625,-99) );
// itree = 181
fBoostWeights.push_back(0.0207028);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.558852,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486917,-99) ,
8, 1.43102, 0, 0, 0.524579,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500837,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48493,-99) ,
12, 1.06716, 0, 0, 0.496221,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.442637,-99) ,
12, -0.649978, 0, 0, 0.49343,-99) ,
10, -1.57141, 1, 0, 0.496247,-99) );
// itree = 182
fBoostWeights.push_back(0.0300924);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.576034,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538268,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475928,-99) ,
13, 1.5838, 0, 0, 0.507847,-99) ,
6, -0.465789, 1, 0, 0.526978,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507598,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489501,-99) ,
2, 0.0712588, 0, 0, 0.492796,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44812,-99) ,
12, -0.646778, 0, 0, 0.49046,-99) ,
10, -1.57144, 1, 0, 0.493775,-99) );
// itree = 183
fBoostWeights.push_back(0.0230316);
fForest.push_back(
NN(
NN(
0,
0,
-1, 1.24501, 0, 1, 0.538566,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508927,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492326,-99) ,
11, 1.20463, 0, 0, 0.498468,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454907,-99) ,
12, -0.808312, 0, 0, 0.496449,-99) ,
10, -1.85713, 1, 0, 0.498889,-99) );
// itree = 184
fBoostWeights.push_back(0.0153284);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.546743,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.564122,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490612,-99) ,
3, 1.24394, 0, 0, 0.529922,-99) ,
NN(
0,
0,
-1, -0.73156, 0, -1, 0.4958,-99) ,
10, -1.85715, 1, 0, 0.49777,-99) ,
3, 2.73085, 0, 0, 0.499551,-99) );
// itree = 185
fBoostWeights.push_back(0.021647);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.376677, 1, 1, 0.528703,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526703,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496001,-99) ,
5, 0.999524, 1, 0, 0.501104,-99) ,
10, -1.57145, 1, 0, 0.503615,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463083,-99) ,
4, 9.37401, 1, 0, 0.501911,-99) );
// itree = 186
fBoostWeights.push_back(0.0134416);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.72271, 0, 1, 0.536113,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533956,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498488,-99) ,
10, -1.85708, 1, 0, 0.500529,-99) ,
2, 0.214127, 0, 0, 0.502666,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461862,-99) ,
4, 9.42577, 1, 0, 0.500955,-99) );
// itree = 187
fBoostWeights.push_back(0.0204058);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.79144, 0, 1, 0.525925,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.555593,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499854,-99) ,
6, -0.447633, 1, 0, 0.504354,-99) ,
NN(
0,
0,
-1, 4.71377, 0, -1, 0.459204,-99) ,
8, 1.19607, 0, 0, 0.499402,-99) ,
12, 8.07998, 0, 0, 0.501867,-99) );
// itree = 188
fBoostWeights.push_back(0.0201426);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.54073,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505831,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46611,-99) ,
8, 0.933914, 0, 0, 0.503629,-99) ,
NN(
0,
0,
-1, 0.498091, 1, -1, 0.464081,-99) ,
7, 0.0238014, 1, 0, 0.501507,-99) ,
6, -0.819757, 1, 0, 0.502928,-99) );
// itree = 189
fBoostWeights.push_back(0.0309434);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.39649, 0, 1, 0.538427,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523776,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496278,-99) ,
3, 1.8985, 0, 0, 0.502228,-99) ,
10, -1.28572, 1, 0, 0.505671,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530521,-99) ,
NN(
0,
0,
-1, -0.587142, 0, -1, 0.454195,-99) ,
11, -2.63921, 1, 0, 0.483532,-99) ,
12, -0.00766644, 0, 0, 0.50222,-99) );
// itree = 190
fBoostWeights.push_back(0.0376579);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.999988, 0, 1, 0.52322,-99) ,
NN(
0,
0,
-1, -0.420958, 0, -1, 0.449125,-99) ,
5, 0.999741, 0, 0, 0.513968,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50506,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463246,-99) ,
3, 1.4721, 0, 0, 0.498873,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.436621,-99) ,
10, 1.85713, 1, 0, 0.495492,-99) ,
6, -0.189385, 1, 0, 0.503613,-99) );
// itree = 191
fBoostWeights.push_back(0.0361033);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.32213, 1, 1, 0.512847,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51162,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470067,-99) ,
6, -0.504912, 1, 0, 0.495251,-99) ,
8, 1.4151, 0, 0, 0.506162,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536943,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486107,-99) ,
9, -949.113, 0, 0, 0.508088,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504408,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.422706,-99) ,
9, -951.273, 1, 0, 0.469028,-99) ,
5, 0.999524, 1, 0, 0.483386,-99) ,
6, 0.348046, 1, 0, 0.502103,-99) );
// itree = 192
fBoostWeights.push_back(0.0317071);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541541,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511588,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480842,-99) ,
11, 0.712631, 0, 0, 0.500654,-99) ,
8, 2.02843, 0, 0, 0.503842,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500292,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454197,-99) ,
12, -0.605608, 0, 0, 0.491063,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.43695,-99) ,
10, 1.57145, 1, 0, 0.485594,-99) ,
6, 0.079024, 1, 0, 0.497407,-99) );
// itree = 193
fBoostWeights.push_back(0.0347839);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.585592,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533208,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.452236,-99) ,
8, 1.64438, 0, 0, 0.481194,-99) ,
9, -951.236, 0, 0, 0.510613,-99) ,
NN(
0,
0,
-1, 0.525285, 1, -1, 0.491812,-99) ,
10, -1.00001, 1, 0, 0.495531,-99) );
// itree = 194
fBoostWeights.push_back(0.0439282);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.999067, 1, 1, 0.52204,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513584,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.448215,-99) ,
11, 1.85521, 0, 0, 0.495292,-99) ,
8, 1.51902, 0, 0, 0.506419,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535822,-99) ,
NN(
0,
0,
-1, -0.632274, 0, -1, 0.482268,-99) ,
3, 2.77354, 0, 0, 0.487104,-99) ,
6, 0.0810337, 1, 0, 0.499649,-99) );
// itree = 195
fBoostWeights.push_back(0.027825);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.44043, 0, 1, 0.541727,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500455,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.449229,-99) ,
4, 8.98818, 1, 0, 0.497967,-99) ,
6, -0.309976, 1, 0, 0.503609,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514985,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467769,-99) ,
9, -951.227, 1, 0, 0.497232,-99) ,
NN(
0,
0,
-1, 1.76397, 0, -1, 0.438237,-99) ,
11, 3.07778, 0, 0, 0.484385,-99) ,
8, 1.34175, 0, 0, 0.498441,-99) );
// itree = 196
fBoostWeights.push_back(0.0232774);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.570607,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491282,-99) ,
8, 1.45166, 0, 0, 0.528027,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504934,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488071,-99) ,
10, 0.224514, 1, 0, 0.497313,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45377,-99) ,
12, -0.741647, 0, 0, 0.495045,-99) ,
10, -1.85714, 1, 0, 0.496924,-99) );
// itree = 197
fBoostWeights.push_back(0.0206583);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.540922,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530238,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497466,-99) ,
10, -1.28567, 1, 0, 0.500327,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501746,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.446539,-99) ,
11, -1.99855, 1, 0, 0.476413,-99) ,
12, 0.38965, 0, 0, 0.49542,-99) ,
3, 2.73085, 0, 0, 0.497088,-99) );
// itree = 198
fBoostWeights.push_back(0.0307599);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515028,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487053,-99) ,
12, 0.826645, 0, 0, 0.503986,-99) ,
NN(
0,
0,
-1, 2.79705, 0, -1, 0.486217,-99) ,
3, 1.13738, 0, 0, 0.499976,-99) ,
NN(
0,
0,
-1, 0.490154, 0, -1, 0.466905,-99) ,
0, 0.491424, 0, 0, 0.497773,-99) );
// itree = 199
fBoostWeights.push_back(0.0218755);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.57144, 1, 1, 0.503155,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530717,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460454,-99) ,
11, -2.48462, 1, 0, 0.484703,-99) ,
12, 0.301516, 0, 0, 0.499448,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.450832,-99) ,
5, 0.99619, 0, 0, 0.49811,-99) );
// itree = 200
fBoostWeights.push_back(0.0211488);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.544871,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498334,-99) ,
3, 1.24093, 0, 0, 0.523485,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507299,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491601,-99) ,
8, 1.76253, 0, 0, 0.49867,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45185,-99) ,
12, -0.822162, 0, 0, 0.496584,-99) ,
10, -1.85715, 1, 0, 0.498122,-99) );
// itree = 201
fBoostWeights.push_back(0.0322264);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.50428, 0, 1, 0.527462,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509741,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492663,-99) ,
8, 1.96259, 0, 0, 0.49792,-99) ,
10, -1.00001, 1, 0, 0.502179,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5409,-99) ,
NN(
0,
0,
-1, -0.661261, 0, -1, 0.449158,-99) ,
11, -2.82139, 1, 0, 0.478082,-99) ,
12, -0.0983186, 0, 0, 0.498753,-99) );
// itree = 202
fBoostWeights.push_back(0.0189344);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.28558, 1, 1, 0.507786,-99) ,
NN(
0,
0,
-1, 1.39206, 0, -1, 0.491875,-99) ,
12, 1.89059, 0, 0, 0.499502,-99) ,
NN(
0,
0,
-1, 0.505981, 1, -1, 0.465952,-99) ,
0, 0.504757, 1, 0, 0.497568,-99) );
// itree = 203
fBoostWeights.push_back(0.0346294);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.17357, 0, 1, 0.53355,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506756,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461182,-99) ,
10, 0.718747, 0, 0, 0.475782,-99) ,
9, -43.5495, 1, 0, 0.511463,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503082,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.453264,-99) ,
10, 1.28569, 1, 0, 0.49775,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.421735,-99) ,
3, 1.19907, 0, 0, 0.493786,-99) ,
11, 1.80972, 0, 0, 0.498927,-99) );
// itree = 204
fBoostWeights.push_back(0.0336111);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537725,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525264,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494903,-99) ,
3, 2.20361, 0, 0, 0.497284,-99) ,
10, -1.57143, 1, 0, 0.49961,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.576419,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457438,-99) ,
12, -0.862711, 0, 0, 0.511706,-99) ,
NN(
0,
0,
-1, -0.375891, 1, -1, 0.455345,-99) ,
11, -2.29908, 1, 0, 0.481937,-99) ,
12, 0.239737, 0, 0, 0.496144,-99) );
// itree = 205
fBoostWeights.push_back(0.0248793);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.56249,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507059,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48644,-99) ,
8, 1.0286, 0, 0, 0.502075,-99) ,
10, -1.28564, 1, 0, 0.505894,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50086,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.436274,-99) ,
10, 0.861943, 1, 0, 0.494379,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.387594,-99) ,
8, 1.39804, 0, 0, 0.488624,-99) ,
12, 1.77483, 0, 0, 0.49728,-99) );
// itree = 206
fBoostWeights.push_back(0.0478726);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.578232,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489398,-99) ,
8, 0.741891, 0, 0, 0.529031,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.602665,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490545,-99) ,
11, -1.39286, 1, 0, 0.496202,-99) ,
12, 9.05629, 0, 0, 0.499434,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.578586,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464104,-99) ,
12, -0.187206, 0, 0, 0.490799,-99) ,
NN(
0,
0,
-1, -1.01716, 1, -1, 0.442612,-99) ,
11, -1.83208, 1, 0, 0.475799,-99) ,
12, 0.361928, 0, 0, 0.494268,-99) );
// itree = 207
fBoostWeights.push_back(0.0348346);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.714274, 1, 1, 0.519826,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506235,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.430913,-99) ,
5, 0.999048, 0, 0, 0.499551,-99) ,
9, -2.17862, 0, 0, 0.506369,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.540072,-99) ,
NN(
0,
0,
-1, -0.739486, 0, -1, 0.473314,-99) ,
11, -2.93034, 1, 0, 0.486033,-99) ,
12, 0.239737, 0, 0, 0.50236,-99) );
// itree = 208
fBoostWeights.push_back(0.0273953);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.570608,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509421,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490246,-99) ,
8, 1.22811, 0, 0, 0.502303,-99) ,
10, -1.28571, 1, 0, 0.506786,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502127,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.438887,-99) ,
10, 0.829539, 1, 0, 0.495509,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.409392,-99) ,
13, 1.43039, 0, 0, 0.489711,-99) ,
12, 1.72945, 0, 0, 0.49842,-99) );
// itree = 209
fBoostWeights.push_back(0.0335017);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.973972, 0, 1, 0.532027,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508933,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466885,-99) ,
10, 0.720309, 0, 0, 0.480592,-99) ,
9, -43.22, 1, 0, 0.512234,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.557659,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494013,-99) ,
10, -1.85705, 1, 0, 0.497253,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.398447,-99) ,
13, 1.3021, 0, 0, 0.493582,-99) ,
11, 2.10924, 0, 0, 0.498609,-99) );
// itree = 210
fBoostWeights.push_back(0.0403256);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.714274, 1, 1, 0.518436,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501582,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.428363,-99) ,
5, 0.999048, 0, 0, 0.495321,-99) ,
9, -949.024, 0, 0, 0.503301,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.589175,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466473,-99) ,
12, -0.500511, 0, 0, 0.508834,-99) ,
NN(
0,
0,
-1, -0.305382, 1, -1, 0.453141,-99) ,
11, -2.04561, 1, 0, 0.483482,-99) ,
12, 0.413866, 0, 0, 0.498784,-99) );
// itree = 211
fBoostWeights.push_back(0.0340768);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.23211, 0, 1, 0.5103,-99) ,
NN(
0,
0,
-1, 3.08541, 0, -1, 0.4787,-99) ,
8, 1.32129, 0, 0, 0.501854,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519013,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487296,-99) ,
9, -1.69972, 0, 0, 0.498168,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.423961,-99) ,
12, 1.17482, 0, 0, 0.486425,-99) ,
10, 0.428555, 1, 0, 0.49668,-99) );
// itree = 212
fBoostWeights.push_back(0.02034);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534951,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.553703,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49976,-99) ,
10, -1.28573, 1, 0, 0.503087,-99) ,
NN(
0,
0,
-1, 1.41447, 0, -1, 0.485115,-99) ,
12, 1.89195, 0, 0, 0.49407,-99) ,
3, 2.73085, 0, 0, 0.49556,-99) );
// itree = 213
fBoostWeights.push_back(0.0371435);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.567618,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524189,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472795,-99) ,
12, 8.35485, 0, 0, 0.501474,-99) ,
8, 1.12913, 0, 0, 0.515512,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.593086,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493353,-99) ,
11, 1.81941, 0, 0, 0.497997,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4369,-99) ,
12, 3.56813, 1, 0, 0.493479,-99) ,
11, 3.67998, 0, 0, 0.497923,-99) );
// itree = 214
fBoostWeights.push_back(0.0166957);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.543964,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504212,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486839,-99) ,
12, 0.436451, 0, 0, 0.500522,-99) ,
10, -2.14284, 1, 0, 0.501982,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466561,-99) ,
5, 0.997143, 0, 0, 0.500673,-99) );
// itree = 215
fBoostWeights.push_back(0.0476972);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.58268,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462213,-99) ,
3, 1.91252, 1, 0, 0.546946,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.545382,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466363,-99) ,
8, 1.742, 0, 0, 0.49327,-99) ,
9, -949.96, 0, 0, 0.51049,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502088,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479305,-99) ,
10, 1.36734, 1, 0, 0.497927,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506184,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.416155,-99) ,
9, -950.041, 1, 0, 0.463176,-99) ,
12, 0.438655, 0, 0, 0.493749,-99) ,
10, -0.428558, 1, 0, 0.499864,-99) );
// itree = 216
fBoostWeights.push_back(0.0482611);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.572524,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465802,-99) ,
8, 2.0906, 1, 0, 0.538217,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.561142,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476902,-99) ,
8, 1.94969, 0, 0, 0.495977,-99) ,
9, -949.113, 0, 0, 0.509486,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522824,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491393,-99) ,
3, 2.04876, 0, 0, 0.495786,-99) ,
NN(
0,
0,
-1, -1.83251, 1, -1, 0.457669,-99) ,
12, 0.470221, 0, 0, 0.491059,-99) ,
10, -0.428577, 1, 0, 0.497775,-99) );
// itree = 217
fBoostWeights.push_back(0.0225515);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.542951,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522333,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4982,-99) ,
5, 0.999524, 1, 0, 0.501841,-99) ,
10, -1.57142, 1, 0, 0.504304,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527752,-99) ,
NN(
0,
0,
-1, -0.440074, 0, -1, 0.465425,-99) ,
11, -2.78041, 1, 0, 0.483983,-99) ,
12, 0.0308507, 0, 0, 0.501021,-99) );
// itree = 218
fBoostWeights.push_back(0.0358315);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.569869,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476152,-99) ,
8, 2.08991, 1, 0, 0.540091,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.543124,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477114,-99) ,
8, 1.74219, 0, 0, 0.499521,-99) ,
9, -949.657, 0, 0, 0.512506,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530899,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498851,-99) ,
12, 10.2924, 0, 0, 0.501436,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463549,-99) ,
12, 0.245683, 0, 0, 0.498088,-99) ,
10, -0.428592, 1, 0, 0.503336,-99) );
// itree = 219
fBoostWeights.push_back(0.0364356);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.193448, 1, 1, 0.518207,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509995,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.450324,-99) ,
5, 0.999524, 0, 0, 0.493392,-99) ,
0, 0.493102, 0, 0, 0.51199,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.598702,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477817,-99) ,
9, -951.223, 0, 0, 0.524148,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537105,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491362,-99) ,
10, -1.5714, 1, 0, 0.495563,-99) ,
5, 0.999524, 1, 0, 0.499997,-99) ,
0, 0.49809, 1, 0, 0.506017,-99) );
// itree = 220
fBoostWeights.push_back(0.0253521);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.558845,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499692,-99) ,
9, -951.286, 0, 0, 0.517442,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51026,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490639,-99) ,
9, -948.705, 1, 0, 0.502778,-99) ,
10, -0.714295, 1, 0, 0.506793,-99) ,
NN(
0,
0,
-1, 1.45938, 0, -1, 0.479332,-99) ,
0, 0.491424, 0, 0, 0.504941,-99) );
// itree = 221
fBoostWeights.push_back(0.0253397);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541542,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511648,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495008,-99) ,
12, 0.750086, 0, 0, 0.507484,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.446591,-99) ,
12, -0.98288, 0, 0, 0.505105,-99) ,
10, -2.14285, 1, 0, 0.50631,-99) );
// itree = 222
fBoostWeights.push_back(0.013825);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.540926,-99) ,
NN(
NN(
0,
0,
-1, 2.1839, 0, 1, 0.504109,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46899,-99) ,
13, 2.66722, 1, 0, 0.502226,-99) ,
3, 2.71032, 0, 0, 0.503714,-99) );
// itree = 223
fBoostWeights.push_back(0.0208357);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537436,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.555734,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493612,-99) ,
9, -951.273, 0, 0, 0.511805,-99) ,
NN(
0,
0,
-1, 0.460622, 0, -1, 0.495166,-99) ,
10, -0.714317, 1, 0, 0.499761,-99) ,
3, 2.68748, 0, 0, 0.501315,-99) );
// itree = 224
fBoostWeights.push_back(0.0185926);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533342,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506128,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464616,-99) ,
8, 2.70021, 1, 0, 0.504261,-99) ,
3, 2.68007, 0, 0, 0.505511,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467553,-99) ,
1, 0.0237438, 1, 0, 0.504337,-99) );
// itree = 225
fBoostWeights.push_back(0.0321407);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 3.40408, 1, 1, 0.536476,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50326,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.421764,-99) ,
8, 1.42625, 0, 0, 0.498413,-99) ,
11, 1.25769, 0, 0, 0.505573,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529991,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483558,-99) ,
3, 0.877276, 0, 0, 0.499364,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.434533,-99) ,
12, 4.94168, 0, 0, 0.488721,-99) ,
13, 1.18327, 0, 0, 0.502321,-99) );
// itree = 226
fBoostWeights.push_back(0.0177794);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537776,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515474,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496948,-99) ,
10, -0.673455, 1, 0, 0.501328,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4356,-99) ,
12, -1.07662, 0, 0, 0.499159,-99) ,
10, -2.14285, 1, 0, 0.500417,-99) );
// itree = 227
fBoostWeights.push_back(0.021568);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537427,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.545236,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506371,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489589,-99) ,
12, 1.84107, 0, 0, 0.497815,-99) ,
11, -2.95491, 1, 0, 0.499569,-99) ,
6, -0.819757, 1, 0, 0.500926,-99) );
// itree = 228
fBoostWeights.push_back(0.0196053);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.557563,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496812,-99) ,
8, 1.45166, 0, 0, 0.524985,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513088,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495416,-99) ,
3, 1.76304, 0, 0, 0.501253,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464581,-99) ,
12, -0.811599, 0, 0, 0.499566,-99) ,
10, -1.85716, 1, 0, 0.50101,-99) );
// itree = 229
fBoostWeights.push_back(0.0306647);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.28548, 1, 1, 0.531573,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.544628,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487739,-99) ,
3, 1.71205, 0, 0, 0.502438,-99) ,
9, -951.203, 0, 0, 0.511783,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517052,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495334,-99) ,
8, 2.11409, 0, 0, 0.500019,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506042,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.428667,-99) ,
3, 2.36043, 0, 0, 0.470421,-99) ,
12, 0.339136, 0, 0, 0.496973,-99) ,
10, -0.428577, 1, 0, 0.502356,-99) );
// itree = 230
fBoostWeights.push_back(0.0351351);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.99999, 0, 1, 0.523647,-99) ,
NN(
0,
0,
-1, 1.08628, 0, -1, 0.462189,-99) ,
5, 0.999799, 0, 0, 0.514835,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.555316,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495574,-99) ,
11, -2.17548, 1, 0, 0.502568,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.447885,-99) ,
12, -1.09028, 0, 0, 0.499292,-99) ,
6, -0.279389, 1, 0, 0.504974,-99) );
// itree = 231
fBoostWeights.push_back(0.0315731);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.622438,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472715,-99) ,
9, -951.227, 0, 0, 0.530764,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506862,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477231,-99) ,
9, 0.525285, 1, 0, 0.502947,-99) ,
5, 0.999048, 1, 0, 0.505904,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461964,-99) ,
4, 9.42577, 1, 0, 0.504111,-99) );
// itree = 232
fBoostWeights.push_back(0.0164424);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.54107,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515262,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497818,-99) ,
10, -0.673441, 1, 0, 0.50197,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.439785,-99) ,
12, -1.07662, 0, 0, 0.499942,-99) ,
10, -2.14283, 1, 0, 0.501314,-99) );
// itree = 233
fBoostWeights.push_back(0.0225739);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.584455,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490633,-99) ,
13, 0.809633, 0, 0, 0.521731,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505224,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467433,-99) ,
8, 1.19107, 0, 0, 0.501221,-99) ,
12, 8.04958, 0, 0, 0.503164,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469098,-99) ,
0, 0.505709, 1, 0, 0.502009,-99) );
// itree = 234
fBoostWeights.push_back(0.0316389);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.575691,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528487,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466144,-99) ,
12, 13.4628, 0, 0, 0.497323,-99) ,
13, 0.81875, 0, 0, 0.522739,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509968,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48773,-99) ,
7, 0.00339948, 0, 0, 0.501202,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.450021,-99) ,
7, 0.0237973, 1, 0, 0.498954,-99) ,
12, 7.95311, 0, 0, 0.501275,-99) );
// itree = 235
fBoostWeights.push_back(0.0228381);
fForest.push_back(
NN(
NN(
0,
0,
-1, -0.999927, 1, 1, 0.507545,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504865,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4487,-99) ,
10, 0.997133, 1, 0, 0.4991,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.42947,-99) ,
8, 1.42961, 0, 0, 0.493687,-99) ,
12, 2.16808, 0, 0, 0.499678,-99) );
// itree = 236
fBoostWeights.push_back(0.0307543);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.614976,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466915,-99) ,
9, -951.227, 0, 0, 0.524586,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537683,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493212,-99) ,
10, -1.85713, 1, 0, 0.495782,-99) ,
5, 0.999048, 1, 0, 0.498814,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466339,-99) ,
4, 9.14073, 1, 0, 0.497356,-99) );
// itree = 237
fBoostWeights.push_back(0.0422412);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.38561, 1, 1, 0.511057,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511015,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.439303,-99) ,
11, 3.80829, 0, 0, 0.494626,-99) ,
8, 1.30714, 0, 0, 0.506141,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.585198,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462474,-99) ,
11, -2.02141, 1, 0, 0.516237,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514395,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.426121,-99) ,
11, -2.86866, 1, 0, 0.462596,-99) ,
12, -0.411911, 0, 0, 0.485123,-99) ,
12, 0.0997583, 0, 0, 0.502519,-99) );
// itree = 238
fBoostWeights.push_back(0.036065);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.561685,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526185,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462402,-99) ,
6, -0.810715, 1, 0, 0.493628,-99) ,
13, 0.837977, 0, 0, 0.515821,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538448,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490364,-99) ,
11, -1.7594, 1, 0, 0.496688,-99) ,
NN(
0,
0,
-1, -1.21423, 0, -1, 0.457573,-99) ,
12, -0.836276, 0, 0, 0.494171,-99) ,
12, 7.62986, 0, 0, 0.496412,-99) );
// itree = 239
fBoostWeights.push_back(0.0141309);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.567448,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499136,-99) ,
11, 3.80048, 0, 0, 0.502302,-99) ,
NN(
0,
0,
-1, 7.23861, 0, -1, 0.482886,-99) ,
8, 1.12696, 0, 0, 0.499054,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457653,-99) ,
10, 2.14279, 1, 0, 0.49801,-99) );
// itree = 240
fBoostWeights.push_back(0.0255632);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538286,-99) ,
NN(
NN(
0,
0,
-1, 1.44729, 0, 1, 0.508535,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504274,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.440402,-99) ,
11, -1.58701, 1, 0, 0.484688,-99) ,
12, 0.681222, 0, 0, 0.502193,-99) ,
10, -2.14286, 1, 0, 0.503377,-99) );
// itree = 241
fBoostWeights.push_back(0.04239);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526795,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494256,-99) ,
8, 1.60979, 0, 0, 0.508805,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517714,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.447285,-99) ,
11, -2.81795, 1, 0, 0.473416,-99) ,
12, -0.234654, 0, 0, 0.503045,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524253,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485271,-99) ,
9, -951.232, 0, 0, 0.498997,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.426608,-99) ,
12, 1.42394, 0, 0, 0.486841,-99) ,
10, 0.714251, 1, 0, 0.499048,-99) );
// itree = 242
fBoostWeights.push_back(0.0265641);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.561585,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508421,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480748,-99) ,
8, 0.843488, 0, 0, 0.504619,-99) ,
10, -1.28574, 1, 0, 0.508199,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50399,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45169,-99) ,
12, -1.04944, 0, 0, 0.499014,-99) ,
NN(
0,
0,
-1, -0.339956, 1, -1, 0.449632,-99) ,
8, 1.55335, 0, 0, 0.492926,-99) ,
12, 1.77483, 0, 0, 0.500643,-99) );
// itree = 243
fBoostWeights.push_back(0.0346907);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.01615, 0, 1, 0.50996,-99) ,
NN(
0,
0,
-1, 1.60374, 0, -1, 0.48913,-99) ,
10, 0.428555, 1, 0, 0.50175,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.585531,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445116,-99) ,
12, -1.04949, 0, 0, 0.511638,-99) ,
NN(
0,
0,
-1, -0.443567, 0, -1, 0.455092,-99) ,
11, -2.49364, 1, 0, 0.481465,-99) ,
12, -0.0224326, 0, 0, 0.498655,-99) );
// itree = 244
fBoostWeights.push_back(0.0258623);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530288,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502387,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47623,-99) ,
13, 0.860159, 0, 0, 0.499702,-99) ,
10, -1.57143, 1, 0, 0.501367,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5259,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464003,-99) ,
12, -0.553294, 0, 0, 0.497564,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.426455,-99) ,
10, -0.0678978, 1, 0, 0.485483,-99) ,
12, 0.361928, 0, 0, 0.497903,-99) );
// itree = 245
fBoostWeights.push_back(0.0341501);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.563477,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497781,-99) ,
13, 0.789845, 0, 0, 0.522513,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52511,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489239,-99) ,
11, 1.17778, 0, 0, 0.496631,-99) ,
NN(
0,
0,
-1, 5.27034, 0, -1, 0.46088,-99) ,
8, 1.17011, 0, 0, 0.493126,-99) ,
12, 8.06315, 0, 0, 0.495914,-99) );
// itree = 246
fBoostWeights.push_back(0.0359489);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.566628,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.547099,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473795,-99) ,
12, 1.93164, 0, 0, 0.491527,-99) ,
9, -951.286, 0, 0, 0.512404,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.547766,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491295,-99) ,
9, -949.113, 0, 0, 0.513502,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500256,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473784,-99) ,
9, -948.705, 1, 0, 0.490374,-99) ,
5, 0.999524, 1, 0, 0.494221,-99) ,
10, -0.999975, 1, 0, 0.497802,-99) );
// itree = 247
fBoostWeights.push_back(0.0335083);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.565106,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.549299,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475041,-99) ,
12, 1.96955, 0, 0, 0.492661,-99) ,
9, -951.236, 0, 0, 0.512948,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.557908,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487559,-99) ,
3, 0.681961, 0, 0, 0.518797,-99) ,
NN(
0,
0,
-1, 1.04971, 0, -1, 0.491054,-99) ,
12, 9.14088, 0, 0, 0.493462,-99) ,
10, -1.00007, 1, 0, 0.497276,-99) );
// itree = 248
fBoostWeights.push_back(0.0182299);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533328,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.547016,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498765,-99) ,
10, -1.57129, 1, 0, 0.50267,-99) ,
NN(
0,
0,
-1, 2.96843, 0, -1, 0.48536,-99) ,
3, 1.18414, 0, 0, 0.49801,-99) ,
3, 2.55243, 0, 0, 0.500152,-99) );
// itree = 249
fBoostWeights.push_back(0.015009);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.540055,-99) ,
NN(
NN(
0,
0,
-1, 4.62826, 0, 1, 0.504046,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460892,-99) ,
8, 0.930501, 0, 0, 0.501656,-99) ,
12, 11.8934, 0, 0, 0.503365,-99) );
// itree = 250
fBoostWeights.push_back(0.0202419);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.543185,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51512,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4948,-99) ,
10, -0.673492, 1, 0, 0.499538,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455555,-99) ,
12, -0.960835, 0, 0, 0.49778,-99) ,
10, -2.14286, 1, 0, 0.499279,-99) );
// itree = 251
fBoostWeights.push_back(0.0181171);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.498089, 0, 1, 0.527955,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504451,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457911,-99) ,
7, 0.0237902, 1, 0, 0.50249,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.450959,-99) ,
8, 0.940642, 0, 0, 0.500425,-99) ,
12, 9.99987, 0, 0, 0.502193,-99) );
// itree = 252
fBoostWeights.push_back(0.0199385);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.715273, 0, 1, 0.527422,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.555328,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496682,-99) ,
11, -2.26948, 1, 0, 0.500755,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4529,-99) ,
12, -1.12184, 0, 0, 0.498851,-99) ,
6, -0.730314, 1, 0, 0.501027,-99) );
// itree = 253
fBoostWeights.push_back(0.0193434);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.56865,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49047,-99) ,
8, 0.728158, 0, 0, 0.524383,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504229,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461275,-99) ,
12, -0.995202, 0, 0, 0.502088,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.446366,-99) ,
8, 0.948447, 0, 0, 0.500035,-99) ,
12, 9.49449, 0, 0, 0.501776,-99) );
// itree = 254
fBoostWeights.push_back(0.0307681);
fForest.push_back(
NN(
NN(
0,
0,
-1, 1.43696, 0, 1, 0.532508,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51772,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498057,-99) ,
3, 1.44729, 0, 0, 0.506272,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512196,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.446172,-99) ,
11, -1.52294, 1, 0, 0.487735,-99) ,
12, 0.922954, 0, 0, 0.500621,-99) ,
10, -1.85715, 1, 0, 0.502423,-99) );
// itree = 255
fBoostWeights.push_back(0.0250335);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536782,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.56001,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496967,-99) ,
11, -1.90141, 1, 0, 0.501456,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523899,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.423465,-99) ,
11, -2.92435, 1, 0, 0.465888,-99) ,
12, -0.513812, 0, 0, 0.498215,-99) ,
12, 11.9198, 0, 0, 0.499919,-99) );
// itree = 256
fBoostWeights.push_back(0.0338947);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.999985, 0, 1, 0.515342,-99) ,
NN(
0,
0,
-1, 0.497137, 0, -1, 0.46583,-99) ,
5, 0.999682, 0, 0, 0.50978,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.560006,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491338,-99) ,
9, -949.113, 0, 0, 0.518961,-99) ,
NN(
0,
0,
-1, 0.509141, 1, -1, 0.487783,-99) ,
5, 0.999524, 1, 0, 0.495423,-99) ,
6, -0.101659, 1, 0, 0.502724,-99) );
// itree = 257
fBoostWeights.push_back(0.04006);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.28378, 1, 1, 0.514297,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511786,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463506,-99) ,
11, 4.70549, 0, 0, 0.497218,-99) ,
8, 1.30714, 0, 0, 0.509054,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.573423,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.456723,-99) ,
12, -1.17424, 0, 0, 0.520501,-99) ,
NN(
0,
0,
-1, -0.358385, 0, -1, 0.475011,-99) ,
11, -2.52319, 1, 0, 0.491098,-99) ,
12, 0.23922, 0, 0, 0.505537,-99) );
// itree = 258
fBoostWeights.push_back(0.0261117);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.588785,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475561,-99) ,
3, 1.20728, 0, 0, 0.525057,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518852,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496777,-99) ,
5, 0.999524, 1, 0, 0.500099,-99) ,
10, -1.28572, 1, 0, 0.50241,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52064,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504817,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.439436,-99) ,
12, -0.385195, 0, 0, 0.469717,-99) ,
11, -2.79305, 1, 0, 0.485338,-99) ,
12, -0.0224326, 0, 0, 0.499805,-99) );
// itree = 259
fBoostWeights.push_back(0.0322709);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.592118,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51333,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466068,-99) ,
13, 1.37204, 0, 0, 0.493752,-99) ,
9, -949.657, 0, 0, 0.519132,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.532162,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464867,-99) ,
0, 0.493328, 0, 0, 0.516945,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503563,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483451,-99) ,
9, -949.135, 1, 0, 0.496137,-99) ,
5, 0.999524, 1, 0, 0.499573,-99) ,
10, -1.2857, 1, 0, 0.502218,-99) );
// itree = 260
fBoostWeights.push_back(0.0262845);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.549757,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522252,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475554,-99) ,
6, -0.764897, 1, 0, 0.498195,-99) ,
8, 1.03603, 0, 0, 0.513253,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503938,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470623,-99) ,
12, -0.506155, 0, 0, 0.500137,-99) ,
NN(
0,
0,
-1, 4.72982, 0, -1, 0.459972,-99) ,
8, 1.24738, 0, 0, 0.497019,-99) ,
6, -0.55117, 1, 0, 0.499809,-99) );
// itree = 261
fBoostWeights.push_back(0.0207212);
fForest.push_back(
NN(
NN(
0,
0,
-1, 1.45129, 0, 1, 0.522931,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522218,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494945,-99) ,
4, 4.82129, 1, 0, 0.511881,-99) ,
NN(
0,
0,
-1, 1.29289, 0, -1, 0.492359,-99) ,
2, 0.0716093, 0, 0, 0.49593,-99) ,
10, -1.57143, 1, 0, 0.498356,-99) );
// itree = 262
fBoostWeights.push_back(0.0239459);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.10391, 0, 1, 0.52563,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504639,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459797,-99) ,
8, 0.966511, 0, 0, 0.488714,-99) ,
9, -40.0028, 1, 0, 0.511482,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503045,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.447656,-99) ,
10, 1.85713, 1, 0, 0.50061,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445318,-99) ,
3, 1.20106, 0, 0, 0.496984,-99) ,
11, 2.43801, 0, 0, 0.500631,-99) );
// itree = 263
fBoostWeights.push_back(0.0268918);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.543562,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509861,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495757,-99) ,
11, 3.72209, 0, 0, 0.50139,-99) ,
10, -1.28533, 1, 0, 0.504023,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505502,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.452859,-99) ,
10, 0.914952, 1, 0, 0.499658,-99) ,
NN(
0,
0,
-1, -1.1557, 1, -1, 0.448737,-99) ,
13, 1.65706, 0, 0, 0.489851,-99) ,
12, 1.81325, 0, 0, 0.496909,-99) );
// itree = 264
fBoostWeights.push_back(0.0123932);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527003,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497393,-99) ,
3, 2.46059, 0, 0, 0.498849,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469216,-99) ,
6, 0.61578, 1, 0, 0.497492,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.453007,-99) ,
5, 0.996191, 0, 0, 0.496269,-99) );
// itree = 265
fBoostWeights.push_back(0.0323938);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 5.43332, 0, 1, 0.513729,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509732,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.450824,-99) ,
12, 8.46933, 0, 0, 0.488655,-99) ,
3, 0.935756, 0, 0, 0.506332,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502682,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461165,-99) ,
12, -0.774776, 0, 0, 0.497202,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518395,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.431813,-99) ,
11, 0.508906, 0, 0, 0.456545,-99) ,
8, 1.61131, 0, 0, 0.489921,-99) ,
12, 2.13051, 0, 0, 0.497113,-99) );
// itree = 266
fBoostWeights.push_back(0.0303853);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.546037,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503913,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476942,-99) ,
10, 1.97953, 1, 0, 0.502015,-99) ,
10, -1.28571, 1, 0, 0.504813,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515527,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480812,-99) ,
10, -0.532684, 1, 0, 0.493953,-99) ,
NN(
0,
0,
-1, 0.109155, 0, -1, 0.447113,-99) ,
8, 1.58206, 0, 0, 0.487475,-99) ,
12, 1.77483, 0, 0, 0.496221,-99) );
// itree = 267
fBoostWeights.push_back(0.0442319);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5558,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507038,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466226,-99) ,
12, 6.6698, 0, 0, 0.49339,-99) ,
8, 1.24271, 0, 0, 0.506304,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.576583,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479891,-99) ,
12, -0.0393395, 0, 0, 0.507002,-99) ,
NN(
0,
0,
-1, 0.996661, 0, -1, 0.483346,-99) ,
11, -1.59504, 1, 0, 0.489251,-99) ,
6, -0.460478, 1, 0, 0.493177,-99) );
// itree = 268
fBoostWeights.push_back(0.0219673);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.54283,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504433,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472574,-99) ,
13, 0.897579, 0, 0, 0.500589,-99) ,
NN(
0,
0,
-1, 0.1646, 1, -1, 0.481549,-99) ,
12, 0.546641, 0, 0, 0.496013,-99) ,
10, -2.14286, 1, 0, 0.497537,-99) );
// itree = 269
fBoostWeights.push_back(0.0339756);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.555311,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53839,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480325,-99) ,
13, 1.75333, 0, 0, 0.496728,-99) ,
9, -949.96, 0, 0, 0.513097,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535388,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491309,-99) ,
12, 0.855835, 0, 0, 0.505877,-99) ,
NN(
0,
0,
-1, 0.67073, 0, -1, 0.48863,-99) ,
8, 2.1715, 0, 0, 0.49303,-99) ,
10, -1.00003, 1, 0, 0.496988,-99) );
// itree = 270
fBoostWeights.push_back(0.0202758);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.498091, 0, 1, 0.533475,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534188,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489783,-99) ,
3, 1.93415, 0, 0, 0.500693,-99) ,
9, -949.024, 0, 0, 0.512495,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537445,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483205,-99) ,
4, 5.24923, 1, 0, 0.515385,-99) ,
NN(
0,
0,
-1, 0.351045, 1, -1, 0.495575,-99) ,
2, 0.152881, 0, 0, 0.497997,-99) ,
2, -0.0715747, 1, 0, 0.500621,-99) );
// itree = 271
fBoostWeights.push_back(0.0115659);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536817,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522735,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499176,-99) ,
10, -1.16329, 1, 0, 0.501815,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.451393,-99) ,
12, -1.07662, 0, 0, 0.500163,-99) ,
10, -2.14287, 1, 0, 0.501329,-99) );
// itree = 272
fBoostWeights.push_back(0.0229551);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.145904, 1, 1, 0.528535,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512913,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49448,-99) ,
9, -948.526, 0, 0, 0.500726,-99) ,
3, 2.18106, 0, 0, 0.502825,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515035,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500465,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.436704,-99) ,
9, -950.041, 1, 0, 0.471958,-99) ,
5, 0.999048, 1, 0, 0.484848,-99) ,
6, 0.441156, 1, 0, 0.500535,-99) );
// itree = 273
fBoostWeights.push_back(0.0213327);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.542747,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508405,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489947,-99) ,
12, 0.744792, 0, 0, 0.503459,-99) ,
10, -2.14286, 1, 0, 0.504736,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470943,-99) ,
5, 0.997143, 0, 0, 0.50347,-99) );
// itree = 274
fBoostWeights.push_back(0.0152418);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5646,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496025,-99) ,
13, 1.38452, 0, 0, 0.532774,-99) ,
NN(
NN(
0,
0,
-1, 4.78217, 0, 1, 0.503873,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501954,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.453488,-99) ,
9, -951.211, 1, 0, 0.484923,-99) ,
3, 0.978039, 0, 0, 0.50107,-99) ,
10, -1.85714, 1, 0, 0.50285,-99) );
// itree = 275
fBoostWeights.push_back(0.0414483);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536129,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474104,-99) ,
12, -0.646301, 0, 0, 0.519311,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514682,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461919,-99) ,
11, 1.8688, 0, 0, 0.490208,-99) ,
8, 1.51327, 0, 0, 0.506938,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515219,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494399,-99) ,
8, 2.10024, 0, 0, 0.499056,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44654,-99) ,
12, 0.557772, 0, 0, 0.493272,-99) ,
10, -0.14287, 1, 0, 0.499553,-99) );
// itree = 276
fBoostWeights.push_back(0.0308194);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.592125,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521104,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460845,-99) ,
11, -2.4746, 1, 0, 0.493221,-99) ,
12, -0.0446836, 0, 0, 0.518205,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.581412,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498217,-99) ,
8, 1.40646, 0, 0, 0.527504,-99) ,
NN(
0,
0,
-1, 0.367477, 0, -1, 0.493636,-99) ,
10, -1.28573, 1, 0, 0.497198,-99) ,
11, -1.66992, 1, 0, 0.500986,-99) );
// itree = 277
fBoostWeights.push_back(0.0202235);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.548406,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507774,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491136,-99) ,
12, 0.483072, 0, 0, 0.504101,-99) ,
10, -2.14278, 1, 0, 0.505545,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461979,-99) ,
5, 0.996191, 0, 0, 0.504362,-99) );
// itree = 278
fBoostWeights.push_back(0.0220993);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53479,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509367,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494457,-99) ,
12, 0.932305, 0, 0, 0.504801,-99) ,
10, -1.85716, 1, 0, 0.506474,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514017,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49061,-99) ,
4, 2.82941, 0, 0, 0.500284,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44815,-99) ,
6, 0.164462, 1, 0, 0.484166,-99) ,
0, 0.492376, 0, 0, 0.504319,-99) );
// itree = 279
fBoostWeights.push_back(0.030456);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.561784,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505741,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460952,-99) ,
12, 3.8024, 1, 0, 0.503038,-99) ,
11, 3.85429, 0, 0, 0.505989,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.545828,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479396,-99) ,
13, 0.808948, 0, 0, 0.506271,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.440438,-99) ,
12, 7.24914, 0, 0, 0.485087,-99) ,
8, 1.11649, 0, 0, 0.502627,-99) );
// itree = 280
fBoostWeights.push_back(0.0100195);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53237,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535725,-99) ,
NN(
0,
0,
-1, -0.810912, 0, -1, 0.49717,-99) ,
10, -2.14286, 1, 0, 0.498437,-99) ,
3, 2.71032, 0, 0, 0.499747,-99) );
// itree = 281
fBoostWeights.push_back(0.0160808);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.735077, 0, 1, 0.522945,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.546555,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498558,-99) ,
11, 3.68614, 0, 0, 0.502054,-99) ,
NN(
0,
0,
-1, -0.143595, 0, -1, 0.465914,-99) ,
8, 1.05842, 0, 0, 0.499497,-99) ,
6, -0.730143, 1, 0, 0.501291,-99) );
// itree = 282
fBoostWeights.push_back(0.0116312);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.540585,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524297,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499573,-99) ,
10, -1.16329, 1, 0, 0.502313,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454103,-99) ,
12, -1.0097, 0, 0, 0.500529,-99) ,
10, -2.14287, 1, 0, 0.50182,-99) );
// itree = 283
fBoostWeights.push_back(0.019571);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534002,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484039,-99) ,
3, 1.2568, 0, 0, 0.515207,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529659,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497852,-99) ,
5, 0.999093, 1, 0, 0.50058,-99) ,
10, -1.00002, 1, 0, 0.503453,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460758,-99) ,
5, 0.996191, 0, 0, 0.5023,-99) );
// itree = 284
fBoostWeights.push_back(0.0214127);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.61432, 0, 1, 0.507799,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51022,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454006,-99) ,
12, 7.45665, 0, 0, 0.491077,-99) ,
8, 1.11605, 0, 0, 0.505128,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467642,-99) ,
0, 0.489519, 0, 0, 0.504161,-99) );
// itree = 285
fBoostWeights.push_back(0.0345003);
fForest.push_back(
NN(
NN(
0,
0,
-1, 1.25515, 0, 1, 0.527826,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509477,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48152,-99) ,
3, 0.815781, 0, 0, 0.50576,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51787,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455581,-99) ,
11, -1.58024, 1, 0, 0.491309,-99) ,
12, 0.999443, 0, 0, 0.501121,-99) ,
10, -1.85714, 1, 0, 0.50261,-99) );
// itree = 286
fBoostWeights.push_back(0.0101899);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.499042, 0, 1, 0.517484,-99) ,
NN(
0,
0,
-1, 0.527843, 1, -1, 0.497732,-99) ,
2, -0.0919791, 1, 0, 0.500282,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4633,-99) ,
2, -0.357242, 0, 0, 0.499298,-99) );
// itree = 287
fBoostWeights.push_back(0.0128231);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529647,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502602,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462564,-99) ,
5, 0.997143, 0, 0, 0.501411,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454902,-99) ,
8, 2.71163, 1, 0, 0.499952,-99) ,
3, 2.55244, 0, 0, 0.501722,-99) );
// itree = 288
fBoostWeights.push_back(0.0206972);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525744,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.581763,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496539,-99) ,
11, -2.23588, 1, 0, 0.501046,-99) ,
NN(
0,
0,
-1, -1.20586, 0, -1, 0.463561,-99) ,
12, -0.826513, 0, 0, 0.49872,-99) ,
12, 10.4589, 0, 0, 0.500298,-99) );
// itree = 289
fBoostWeights.push_back(0.0296309);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.571546,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495866,-99) ,
12, 0.590686, 0, 0, 0.509354,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516199,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4881,-99) ,
9, -948.526, 0, 0, 0.497564,-99) ,
11, -1.0324, 1, 0, 0.501007,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466396,-99) ,
0, 0.505709, 1, 0, 0.499858,-99) );
// itree = 290
fBoostWeights.push_back(0.0188657);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53721,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492528,-99) ,
6, -0.0984673, 1, 0, 0.522397,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508217,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494758,-99) ,
8, 1.70297, 0, 0, 0.501673,-99) ,
10, -1.57143, 1, 0, 0.503506,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460139,-99) ,
2, -0.357184, 0, 0, 0.502341,-99) );
// itree = 291
fBoostWeights.push_back(0.0228635);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.576721,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490331,-99) ,
13, 0.713083, 0, 0, 0.526959,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519706,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496833,-99) ,
11, 0.964384, 0, 0, 0.503668,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459495,-99) ,
8, 0.958572, 0, 0, 0.501938,-99) ,
12, 9.48182, 0, 0, 0.503726,-99) );
// itree = 292
fBoostWeights.push_back(0.0197667);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535634,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507683,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491618,-99) ,
10, 0.795926, 1, 0, 0.503821,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459403,-99) ,
12, -1.03079, 0, 0, 0.502223,-99) ,
10, -2.1428, 1, 0, 0.503294,-99) );
// itree = 293
fBoostWeights.push_back(0.0251389);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526479,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531436,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478691,-99) ,
9, -40.0028, 1, 0, 0.511083,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501735,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.439817,-99) ,
8, 1.35471, 0, 0, 0.49693,-99) ,
11, 2.68905, 0, 0, 0.500536,-99) ,
3, 2.55244, 0, 0, 0.502079,-99) );
// itree = 294
fBoostWeights.push_back(0.0192142);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538597,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506603,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.482121,-99) ,
10, 2.02033, 1, 0, 0.505444,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500284,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.413299,-99) ,
10, 0.321811, 1, 0, 0.488313,-99) ,
12, 0.836727, 0, 0, 0.500368,-99) ,
10, -2.14285, 1, 0, 0.501613,-99) );
// itree = 295
fBoostWeights.push_back(0.0142529);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522217,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.540601,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497431,-99) ,
6, -0.613878, 1, 0, 0.499619,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.450611,-99) ,
13, 0.905599, 0, 0, 0.497777,-99) ,
12, 10.4707, 0, 0, 0.499215,-99) );
// itree = 296
fBoostWeights.push_back(0.0455354);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.566777,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508148,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.438816,-99) ,
10, 0.120054, 1, 0, 0.496599,-99) ,
12, 0.639388, 0, 0, 0.508827,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536835,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485688,-99) ,
11, 1.45253, 1, 0, 0.510499,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506947,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460645,-99) ,
12, 2.14738, 0, 0, 0.488606,-99) ,
9, -1.58995, 0, 0, 0.495515,-99) ,
11, -0.988433, 1, 0, 0.499509,-99) );
// itree = 297
fBoostWeights.push_back(0.0192709);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528082,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50895,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492699,-99) ,
9, -2.17862, 0, 0, 0.498201,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466156,-99) ,
8, 2.74975, 1, 0, 0.496868,-99) ,
3, 2.73084, 0, 0, 0.497998,-99) );
// itree = 298
fBoostWeights.push_back(0.0152936);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.133937, 0, 1, 0.526687,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503769,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491256,-99) ,
9, -40.0028, 1, 0, 0.499217,-99) ,
10, -1.85714, 1, 0, 0.500748,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460336,-99) ,
5, 0.996191, 0, 0, 0.499653,-99) );
// itree = 299
fBoostWeights.push_back(0.0292456);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.59757,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487796,-99) ,
13, 1.39775, 0, 0, 0.524479,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510451,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492179,-99) ,
3, 1.74717, 0, 0, 0.497902,-99) ,
10, -1.28572, 1, 0, 0.500343,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524614,-99) ,
NN(
0,
0,
-1, -0.436083, 0, -1, 0.462844,-99) ,
11, -2.82139, 1, 0, 0.4826,-99) ,
12, -0.0983186, 0, 0, 0.497852,-99) );
// itree = 300
fBoostWeights.push_back(0.027625);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.15401, 1, 1, 0.507023,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502896,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.429935,-99) ,
11, -2.79059, 1, 0, 0.470385,-99) ,
12, -0.574848, 0, 0, 0.502315,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510884,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479139,-99) ,
9, -43.5495, 1, 0, 0.499358,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.437817,-99) ,
12, 1.55802, 0, 0, 0.492795,-99) ,
8, 1.51253, 0, 0, 0.498744,-99) );
// itree = 301
fBoostWeights.push_back(0.0283148);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.558666,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516918,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467897,-99) ,
12, 7.32984, 0, 0, 0.502673,-99) ,
13, 1.09336, 0, 0, 0.514779,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541349,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495393,-99) ,
6, -0.3709, 1, 0, 0.498844,-99) ,
NN(
0,
0,
-1, 1.21569, 0, -1, 0.466599,-99) ,
8, 1.37657, 0, 0, 0.494928,-99) ,
11, 4.02185, 0, 0, 0.498741,-99) );
// itree = 302
fBoostWeights.push_back(0.0254636);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.556195,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508758,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469141,-99) ,
12, 8.46571, 0, 0, 0.493563,-99) ,
8, 1.06737, 0, 0, 0.511624,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502843,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.446593,-99) ,
12, -1.16322, 0, 0, 0.500131,-99) ,
NN(
0,
0,
-1, 1.13565, 0, -1, 0.467474,-99) ,
8, 1.39804, 0, 0, 0.495783,-99) ,
11, 3.88413, 0, 0, 0.498876,-99) );
// itree = 303
fBoostWeights.push_back(0.0244173);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.578296,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487015,-99) ,
3, 1.17784, 0, 0, 0.533411,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486411,-99) ,
6, -0.107028, 1, 0, 0.517251,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507777,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492078,-99) ,
3, 1.41897, 0, 0, 0.498847,-99) ,
NN(
0,
0,
-1, 0.33845, 1, -1, 0.485603,-99) ,
12, 1.09184, 0, 0, 0.494492,-99) ,
10, -1.57141, 1, 0, 0.496495,-99) );
// itree = 304
fBoostWeights.push_back(0.0269098);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -951.236, 0, 1, 0.519253,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506885,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.446063,-99) ,
12, -1.23838, 0, 0, 0.476456,-99) ,
12, -0.678671, 0, 0, 0.509923,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.552383,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499916,-99) ,
10, 1.76184, 0, 0, 0.504815,-99) ,
NN(
0,
0,
-1, 1.78135, 0, -1, 0.48506,-99) ,
11, 0.661454, 0, 0, 0.494074,-99) ,
10, -0.714283, 1, 0, 0.498369,-99) );
// itree = 305
fBoostWeights.push_back(0.0247286);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 3.37557, 0, 1, 0.527729,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524045,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480793,-99) ,
12, 11.6165, 0, 0, 0.497371,-99) ,
3, 0.914935, 0, 0, 0.514008,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502526,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.430522,-99) ,
10, 1.8571, 1, 0, 0.499554,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.424117,-99) ,
13, 1.30057, 0, 0, 0.496876,-99) ,
11, 2.10924, 0, 0, 0.5015,-99) );
// itree = 306
fBoostWeights.push_back(0.0388374);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.54972,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.54479,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484138,-99) ,
3, 1.71071, 0, 0, 0.497912,-99) ,
9, -949.657, 0, 0, 0.512268,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.540361,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496157,-99) ,
8, 1.12906, 0, 0, 0.507414,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534364,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483611,-99) ,
11, -2.22465, 1, 0, 0.487889,-99) ,
11, 3.57713, 0, 0, 0.492271,-99) ,
10, -0.999979, 1, 0, 0.496181,-99) );
// itree = 307
fBoostWeights.push_back(0.0289385);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.06261, 0, 1, 0.522796,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50698,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475093,-99) ,
6, -0.574054, 1, 0, 0.490563,-99) ,
9, -43.6462, 1, 0, 0.510391,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.581538,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495834,-99) ,
11, -2.01055, 1, 0, 0.501555,-99) ,
NN(
0,
0,
-1, -2.75354, 1, -1, 0.467947,-99) ,
12, -0.446247, 0, 0, 0.497143,-99) ,
11, 2.10924, 0, 0, 0.500732,-99) );
// itree = 308
fBoostWeights.push_back(0.0269972);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.589552,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493434,-99) ,
3, 1.21413, 0, 0, 0.532059,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506766,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493366,-99) ,
10, 0.550994, 1, 0, 0.501511,-99) ,
10, -1.28572, 1, 0, 0.504245,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.549158,-99) ,
NN(
0,
0,
-1, -0.683025, 0, -1, 0.472093,-99) ,
11, -3.00576, 1, 0, 0.486906,-99) ,
12, 0.0998317, 0, 0, 0.501283,-99) );
// itree = 309
fBoostWeights.push_back(0.0259714);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538499,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510443,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492542,-99) ,
11, 0.311798, 0, 0, 0.503782,-99) ,
8, 2.25584, 0, 0, 0.506128,-99) ,
NN(
NN(
0,
0,
-1, 0.997324, 0, 1, 0.522924,-99) ,
NN(
0,
0,
-1, -951.266, 1, -1, 0.482797,-99) ,
5, 0.999048, 1, 0, 0.492859,-99) ,
6, 0.261107, 1, 0, 0.50309,-99) );
// itree = 310
fBoostWeights.push_back(0.0142751);
fForest.push_back(
NN(
NN(
0,
0,
-1, -0.285033, 1, 1, 0.534001,-99) ,
NN(
NN(
0,
0,
-1, 5.597, 0, 1, 0.503112,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509219,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454756,-99) ,
10, 0.222493, 0, 0, 0.477879,-99) ,
3, 0.818724, 0, 0, 0.500809,-99) ,
10, -1.85714, 1, 0, 0.502647,-99) );
// itree = 311
fBoostWeights.push_back(0.0344331);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521023,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470867,-99) ,
9, 0.525285, 1, 0, 0.513541,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506229,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.443805,-99) ,
11, 0.142083, 0, 0, 0.473187,-99) ,
10, 1.28585, 1, 0, 0.507255,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.547532,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494534,-99) ,
10, -1.5716, 1, 0, 0.498008,-99) ,
NN(
0,
0,
-1, -1.50178, 1, -1, 0.461713,-99) ,
12, 0.96018, 0, 0, 0.494004,-99) ,
8, 1.76286, 0, 0, 0.500102,-99) );
// itree = 312
fBoostWeights.push_back(0.0173915);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.544978,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511258,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496562,-99) ,
9, -949.024, 0, 0, 0.501664,-99) ,
3, 2.5018, 0, 0, 0.503107,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502723,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463592,-99) ,
5, 0.999524, 1, 0, 0.480307,-99) ,
6, 0.528609, 1, 0, 0.501154,-99) );
// itree = 313
fBoostWeights.push_back(0.0224396);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.563362,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49599,-99) ,
6, -0.285033, 1, 0, 0.531702,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510676,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495183,-99) ,
10, 0.224463, 1, 0, 0.50364,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.458314,-99) ,
12, -0.72173, 0, 0, 0.501246,-99) ,
10, -1.85715, 1, 0, 0.502935,-99) );
// itree = 314
fBoostWeights.push_back(0.0185447);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52522,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506146,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48723,-99) ,
12, 0.518183, 0, 0, 0.502041,-99) ,
3, 2.5715, 0, 0, 0.50337,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471056,-99) ,
0, 0.505709, 1, 0, 0.502294,-99) );
// itree = 315
fBoostWeights.push_back(0.0173949);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.551997,-99) ,
NN(
NN(
0,
0,
-1, 2.3158, 0, 1, 0.504508,-99) ,
NN(
0,
0,
-1, 0.225407, 1, -1, 0.485188,-99) ,
12, 0.681222, 0, 0, 0.499379,-99) ,
10, -2.14286, 1, 0, 0.501088,-99) );
// itree = 316
fBoostWeights.push_back(0.0109839);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537096,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525819,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49801,-99) ,
2, 0.214539, 0, 0, 0.499594,-99) ,
10, -2.14286, 1, 0, 0.500806,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471471,-99) ,
5, 0.997619, 0, 0, 0.499522,-99) );
// itree = 317
fBoostWeights.push_back(0.0215203);
fForest.push_back(
NN(
NN(
0,
0,
-1, 1.43696, 0, 1, 0.528738,-99) ,
NN(
NN(
0,
0,
-1, 2.30431, 0, 1, 0.503454,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511917,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454339,-99) ,
11, -1.504, 1, 0, 0.491149,-99) ,
12, 0.922954, 0, 0, 0.49972,-99) ,
10, -1.85714, 1, 0, 0.501311,-99) );
// itree = 318
fBoostWeights.push_back(0.0337197);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530154,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.446488,-99) ,
12, -1.08566, 0, 0, 0.515121,-99) ,
NN(
0,
0,
-1, -0.588931, 1, -1, 0.473869,-99) ,
3, 1.12507, 0, 0, 0.505374,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.545343,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495882,-99) ,
12, 3.2902, 1, 0, 0.503018,-99) ,
NN(
0,
0,
-1, 1.63474, 0, -1, 0.488272,-99) ,
11, 1.19235, 0, 0, 0.493982,-99) ,
10, -0.714297, 1, 0, 0.497065,-99) );
// itree = 319
fBoostWeights.push_back(0.0119774);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.525526, 0, 1, 0.519709,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502129,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471053,-99) ,
12, -0.518331, 0, 0, 0.500171,-99) ,
10, -1.57144, 1, 0, 0.501896,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472268,-99) ,
0, 0.505709, 1, 0, 0.500888,-99) );
// itree = 320
fBoostWeights.push_back(0.0346237);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 4.6968, 0, 1, 0.531082,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512884,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466438,-99) ,
12, 8.25624, 0, 0, 0.495631,-99) ,
8, 1.07036, 0, 0, 0.511437,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509674,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481864,-99) ,
10, 0.714373, 1, 0, 0.502541,-99) ,
NN(
0,
0,
-1, 0.703317, 0, -1, 0.46535,-99) ,
8, 1.45043, 0, 0, 0.4981,-99) ,
11, 2.33638, 0, 0, 0.501515,-99) );
// itree = 321
fBoostWeights.push_back(0.0234135);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.57543,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492905,-99) ,
3, 1.17503, 0, 0, 0.535282,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485064,-99) ,
6, -0.0992137, 1, 0, 0.51867,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.539485,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48833,-99) ,
9, -951.286, 1, 0, 0.516175,-99) ,
NN(
0,
0,
-1, -0.141796, 0, -1, 0.492931,-99) ,
3, 2.2528, 0, 0, 0.495951,-99) ,
10, -1.5714, 1, 0, 0.497949,-99) );
// itree = 322
fBoostWeights.push_back(0.0227876);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.589145,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497971,-99) ,
8, 1.27702, 0, 0, 0.544775,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529371,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498849,-99) ,
8, 2.38067, 0, 0, 0.502295,-99) ,
10, -1.57142, 1, 0, 0.504888,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538936,-99) ,
NN(
0,
0,
-1, -0.787686, 0, -1, 0.456753,-99) ,
11, -2.92477, 1, 0, 0.481397,-99) ,
12, -0.190733, 0, 0, 0.501893,-99) );
// itree = 323
fBoostWeights.push_back(0.0259718);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.583556,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493355,-99) ,
3, 1.17091, 0, 0, 0.534028,-99) ,
NN(
0,
0,
-1, 2.10019, 0, 1, 0.50342,-99) ,
10, -1.28572, 1, 0, 0.50609,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.563452,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475913,-99) ,
11, -2.04103, 1, 0, 0.509316,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507398,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.430563,-99) ,
11, -2.80092, 1, 0, 0.469171,-99) ,
12, -0.494884, 0, 0, 0.490928,-99) ,
12, 0.239737, 0, 0, 0.503125,-99) );
// itree = 324
fBoostWeights.push_back(0.0150311);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.557244,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494727,-99) ,
12, 0.316986, 0, 0, 0.525131,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527219,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499545,-99) ,
8, 2.1003, 0, 0, 0.503062,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501047,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.431873,-99) ,
10, 0.254698, 1, 0, 0.489803,-99) ,
12, 0.831273, 0, 0, 0.499268,-99) ,
10, -1.85713, 1, 0, 0.500693,-99) );
// itree = 325
fBoostWeights.push_back(0.0295325);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.579742,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499913,-99) ,
3, 1.20269, 0, 0, 0.532842,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512877,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494999,-99) ,
8, 1.88097, 0, 0, 0.500749,-99) ,
10, -1.28573, 1, 0, 0.503608,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.549657,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472534,-99) ,
11, -2.47843, 1, 0, 0.496178,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.442309,-99) ,
12, -1.2468, 0, 0, 0.486977,-99) ,
12, 0.116956, 0, 0, 0.500708,-99) );
// itree = 326
fBoostWeights.push_back(0.0205154);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.133937, 0, 1, 0.533736,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506667,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4755,-99) ,
8, 0.700667, 0, 0, 0.505015,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500117,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.426606,-99) ,
10, 0.389613, 1, 0, 0.488784,-99) ,
12, 1.06286, 0, 0, 0.499605,-99) ,
10, -1.85715, 1, 0, 0.501496,-99) );
// itree = 327
fBoostWeights.push_back(0.0410793);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5207,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490921,-99) ,
5, 0.999959, 0, 0, 0.510064,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.434015,-99) ,
5, 0.999148, 0, 0, 0.506326,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523634,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48194,-99) ,
12, 1.30391, 0, 0, 0.493728,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.430011,-99) ,
10, 1.85719, 1, 0, 0.48985,-99) ,
6, -0.00920552, 1, 0, 0.499468,-99) );
// itree = 328
fBoostWeights.push_back(0.0262975);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.545388,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514385,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466084,-99) ,
12, 8.41998, 0, 0, 0.497974,-99) ,
8, 1.03874, 0, 0, 0.513509,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.532174,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497002,-99) ,
11, 1.62001, 0, 0, 0.501196,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.40872,-99) ,
13, 1.21535, 0, 0, 0.498055,-99) ,
11, 3.93894, 0, 0, 0.501035,-99) );
// itree = 329
fBoostWeights.push_back(0.0149718);
fForest.push_back(
NN(
NN(
0,
0,
-1, 3.06635, 1, 1, 0.525461,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503808,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463579,-99) ,
5, 0.998095, 0, 0, 0.502607,-99) ,
NN(
0,
0,
-1, 2.52016, 1, -1, 0.477698,-99) ,
6, 0.436968, 1, 0, 0.500422,-99) ,
3, 2.54027, 0, 0, 0.501948,-99) );
// itree = 330
fBoostWeights.push_back(0.0154785);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522479,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524324,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49822,-99) ,
8, 2.01674, 0, 0, 0.501849,-99) ,
NN(
0,
0,
-1, -0.649398, 0, -1, 0.485012,-99) ,
6, 0.250013, 1, 0, 0.498623,-99) ,
3, 2.5715, 0, 0, 0.499988,-99) );
// itree = 331
fBoostWeights.push_back(0.0189901);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.569721,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494948,-99) ,
3, 1.20728, 0, 0, 0.529484,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521915,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499853,-99) ,
5, 0.999524, 1, 0, 0.503287,-99) ,
10, -1.28571, 1, 0, 0.505769,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515913,-99) ,
NN(
0,
0,
-1, -0.67827, 0, -1, 0.461913,-99) ,
11, -2.90947, 1, 0, 0.478991,-99) ,
12, -0.235092, 0, 0, 0.502514,-99) );
// itree = 332
fBoostWeights.push_back(0.0167861);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538031,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509104,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495792,-99) ,
11, 0.311295, 0, 0, 0.502218,-99) ,
10, -2.14285, 1, 0, 0.503348,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461826,-99) ,
5, 0.996191, 0, 0, 0.502225,-99) );
// itree = 333
fBoostWeights.push_back(0.0161514);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.267781, 0, 1, 0.528687,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5054,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475074,-99) ,
13, 0.704315, 0, 0, 0.504071,-99) ,
10, -1.85715, 1, 0, 0.505415,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478829,-99) ,
5, 0.997619, 0, 0, 0.504259,-99) );
// itree = 334
fBoostWeights.push_back(0.0310976);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.551104,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475498,-99) ,
12, -0.746314, 0, 0, 0.523566,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513446,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.458172,-99) ,
11, 0.0528224, 0, 0, 0.497699,-99) ,
13, 1.64896, 0, 0, 0.509325,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526314,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496898,-99) ,
3, 2.23668, 0, 0, 0.499476,-99) ,
NN(
0,
0,
-1, -0.0325956, 0, -1, 0.475169,-99) ,
12, 0.315635, 0, 0, 0.497072,-99) ,
10, -0.428531, 1, 0, 0.501505,-99) );
// itree = 335
fBoostWeights.push_back(0.0185607);
fForest.push_back(
NN(
NN(
0,
0,
-1, 1.38193, 0, 1, 0.527796,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.540044,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493942,-99) ,
9, -950.041, 1, 0, 0.519212,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503457,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459676,-99) ,
12, -0.254405, 0, 0, 0.501092,-99) ,
3, 2.20925, 0, 0, 0.50369,-99) ,
10, -1.85714, 1, 0, 0.505009,-99) );
// itree = 336
fBoostWeights.push_back(0.0192066);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.54124,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.593734,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489965,-99) ,
12, 0.189837, 0, 0, 0.51296,-99) ,
NN(
0,
0,
-1, 0.523061, 0, -1, 0.496644,-99) ,
11, -1.47442, 1, 0, 0.500008,-99) ,
10, -2.14286, 1, 0, 0.501326,-99) );
// itree = 337
fBoostWeights.push_back(0.012009);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534579,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527106,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499422,-99) ,
4, 4.5594, 1, 0, 0.515761,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501397,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474516,-99) ,
6, 0.617611, 1, 0, 0.500072,-99) ,
2, -0.0714997, 1, 0, 0.502919,-99) ,
10, -2.14286, 1, 0, 0.503931,-99) );
// itree = 338
fBoostWeights.push_back(0.0190567);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.568363,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491492,-99) ,
9, -12.1436, 1, 0, 0.531474,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490547,-99) ,
10, 0.714389, 1, 0, 0.518449,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515087,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499883,-99) ,
3, 1.57509, 0, 0, 0.504306,-99) ,
NN(
0,
0,
-1, -0.239893, 1, -1, 0.486498,-99) ,
12, 0.758589, 0, 0, 0.500374,-99) ,
3, 2.23668, 0, 0, 0.502722,-99) );
// itree = 339
fBoostWeights.push_back(0.0196424);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.551578,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497306,-99) ,
9, -950.041, 1, 0, 0.526139,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5225,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492731,-99) ,
13, 0.831224, 0, 0, 0.513343,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501658,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.417728,-99) ,
8, 1.26959, 0, 0, 0.498504,-99) ,
11, 2.7817, 0, 0, 0.502328,-99) ,
3, 2.41215, 0, 0, 0.50435,-99) );
// itree = 340
fBoostWeights.push_back(0.0119619);
fForest.push_back(
NN(
NN(
0,
0,
-1, 1.37428, 0, 1, 0.520924,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521347,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501589,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475331,-99) ,
12, -0.153227, 0, 0, 0.499493,-99) ,
3, 2.55244, 0, 0, 0.500852,-99) ,
10, -1.57144, 1, 0, 0.502611,-99) );
// itree = 341
fBoostWeights.push_back(0.0385938);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.568541,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493954,-99) ,
12, -0.145147, 0, 0, 0.525913,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521816,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486801,-99) ,
9, -1.26137, 0, 0, 0.496518,-99) ,
13, 2.00878, 0, 0, 0.504487,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506154,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.468003,-99) ,
10, 2.02039, 1, 0, 0.502037,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.418845,-99) ,
12, 0.98183, 0, 0, 0.49233,-99) ,
10, 0.428564, 1, 0, 0.500392,-99) );
// itree = 342
fBoostWeights.push_back(0.0191778);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.591619,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484629,-99) ,
12, -0.520175, 0, 0, 0.534711,-99) ,
NN(
0,
0,
-1, 0, 1, 1, 0.506841,-99) ,
13, 1.33983, 0, 0, 0.524087,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520892,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496509,-99) ,
11, -1.67868, 1, 0, 0.500545,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471103,-99) ,
8, 0.702841, 0, 0, 0.499445,-99) ,
10, -1.57143, 1, 0, 0.501613,-99) );
// itree = 343
fBoostWeights.push_back(0.0214381);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.549002,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498991,-99) ,
9, -951.286, 1, 0, 0.525487,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515863,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494857,-99) ,
8, 1.25642, 0, 0, 0.505962,-99) ,
NN(
0,
0,
-1, 1.2853, 1, -1, 0.49242,-99) ,
11, 0.294969, 0, 0, 0.499362,-99) ,
3, 2.41215, 0, 0, 0.501612,-99) );
// itree = 344
fBoostWeights.push_back(0.0349386);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.547073,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520226,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484056,-99) ,
12, 8.20308, 0, 0, 0.506456,-99) ,
8, 1.09144, 0, 0, 0.517434,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514309,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491275,-99) ,
10, 0.428585, 1, 0, 0.506144,-99) ,
NN(
0,
0,
-1, 1.22642, 0, -1, 0.46389,-99) ,
8, 1.39206, 0, 0, 0.500999,-99) ,
11, 3.67998, 0, 0, 0.504321,-99) );
// itree = 345
fBoostWeights.push_back(0.0138092);
fForest.push_back(
NN(
NN(
0,
0,
-1, -0.277615, 1, 1, 0.531426,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527948,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49219,-99) ,
10, 0.455836, 1, 0, 0.513116,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500571,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.468243,-99) ,
12, -0.134511, 0, 0, 0.498802,-99) ,
3, 2.09346, 0, 0, 0.501448,-99) ,
10, -1.85715, 1, 0, 0.503094,-99) );
// itree = 346
fBoostWeights.push_back(0.0251419);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.550097,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480383,-99) ,
10, 1.00011, 1, 0, 0.531523,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517826,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457087,-99) ,
12, -0.0231252, 0, 0, 0.487619,-99) ,
9, -949.657, 1, 0, 0.512192,-99) ,
NN(
NN(
0,
0,
-1, -1.28574, 1, 1, 0.504442,-99) ,
NN(
0,
0,
-1, 1.65244, 0, -1, 0.488732,-99) ,
11, 0.00413985, 0, 0, 0.498614,-99) ,
3, 2.0788, 0, 0, 0.501157,-99) );
// itree = 347
fBoostWeights.push_back(0.0217457);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.550712, 1, 1, 0.527715,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531482,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490608,-99) ,
3, 1.17247, 0, 0, 0.518608,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5033,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49023,-99) ,
8, 1.86281, 0, 0, 0.495098,-99) ,
10, -1.28571, 1, 0, 0.498286,-99) ,
3, 2.51744, 0, 0, 0.500218,-99) );
// itree = 348
fBoostWeights.push_back(0.00858981);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.544155,-99) ,
NN(
NN(
0,
0,
-1, 2.41215, 0, 1, 0.50179,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465858,-99) ,
12, -1.0097, 0, 0, 0.500475,-99) ,
10, -2.14286, 1, 0, 0.501874,-99) );
// itree = 349
fBoostWeights.push_back(0.0155508);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529868,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.532881,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495011,-99) ,
6, 0.474204, 1, 0, 0.51299,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500564,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483929,-99) ,
12, 1.26401, 0, 0, 0.495497,-99) ,
3, 2.22639, 0, 0, 0.497886,-99) ,
10, -2.14286, 1, 0, 0.498895,-99) );
// itree = 350
fBoostWeights.push_back(0.025508);
fForest.push_back(
NN(
NN(
0,
0,
-1, 1.38448, 0, 1, 0.52617,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514398,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490535,-99) ,
8, 1.74167, 0, 0, 0.501528,-99) ,
NN(
0,
0,
-1, 1.44316, 0, -1, 0.487168,-99) ,
10, 0.918336, 1, 0, 0.498587,-99) ,
10, -1.85713, 1, 0, 0.50012,-99) );
// itree = 351
fBoostWeights.push_back(0.0138288);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535643,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497556,-99) ,
13, 2.96026, 1, 0, 0.516708,-99) ,
NN(
NN(
0,
0,
-1, 2.29305, 0, 1, 0.502575,-99) ,
NN(
0,
0,
-1, -0.0771873, 1, -1, 0.483787,-99) ,
12, 0.695411, 0, 0, 0.498257,-99) ,
3, 2.39456, 0, 0, 0.499912,-99) );
// itree = 352
fBoostWeights.push_back(0.00716077);
fForest.push_back(
NN(
NN(
0,
0,
-1, 2.54027, 0, 1, 0.502463,-99) ,
NN(
0,
0,
-1, 1.35919, 0, -1, 0.480911,-99) ,
0, 0.491424, 0, 0, 0.501015,-99) );
// itree = 353
fBoostWeights.push_back(0.0181761);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527277,-99) ,
NN(
NN(
0,
0,
-1, 1.21192, 0, 1, 0.5081,-99) ,
NN(
0,
0,
-1, 1.30519, 0, -1, 0.492124,-99) ,
11, 2.70344, 0, 0, 0.49618,-99) ,
3, 2.55243, 0, 0, 0.498035,-99) );
// itree = 354
fBoostWeights.push_back(0.0206609);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.714477, 1, 1, 0.530171,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500902,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467734,-99) ,
12, -0.832954, 0, 0, 0.497994,-99) ,
6, -0.316713, 1, 0, 0.502065,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5112,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487509,-99) ,
13, 0.930808, 0, 0, 0.499929,-99) ,
NN(
0,
0,
-1, 1.25732, 0, -1, 0.450233,-99) ,
11, 3.07778, 0, 0, 0.489853,-99) ,
8, 1.3361, 0, 0, 0.498819,-99) );
// itree = 355
fBoostWeights.push_back(0.0295798);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.574119,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517798,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475224,-99) ,
8, 1.45166, 0, 0, 0.496612,-99) ,
9, -951.286, 0, 0, 0.516671,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526759,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495698,-99) ,
10, 0.142675, 1, 0, 0.509261,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504433,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487181,-99) ,
11, 5.19415, 0, 0, 0.491237,-99) ,
8, 2.15556, 0, 0, 0.495853,-99) ,
10, -1.28574, 1, 0, 0.49863,-99) );
// itree = 356
fBoostWeights.push_back(0.0267295);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.567921,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.548574,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475337,-99) ,
11, 0.738368, 0, 0, 0.495762,-99) ,
9, -949.657, 0, 0, 0.514269,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508092,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492453,-99) ,
3, 1.77479, 0, 0, 0.49746,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.468066,-99) ,
12, -0.444287, 0, 0, 0.495734,-99) ,
10, -1.28571, 1, 0, 0.49821,-99) );
// itree = 357
fBoostWeights.push_back(0.0293479);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526662,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464854,-99) ,
12, -0.93943, 0, 0, 0.516411,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508206,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.436602,-99) ,
12, 4.98642, 0, 0, 0.481075,-99) ,
13, 1.18327, 0, 0, 0.509676,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527933,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497699,-99) ,
12, 11.0864, 0, 0, 0.499796,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455281,-99) ,
12, 0.130838, 0, 0, 0.496611,-99) ,
10, -0.428597, 1, 0, 0.501327,-99) );
// itree = 358
fBoostWeights.push_back(0.0201577);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519175,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496889,-99) ,
11, 1.26029, 0, 0, 0.503381,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513317,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.453669,-99) ,
12, 13.0846, 0, 0, 0.482679,-99) ,
13, 0.829322, 0, 0, 0.501873,-99) ,
NN(
0,
0,
-1, 0.0739521, 1, -1, 0.480909,-99) ,
0, 0.491424, 0, 0, 0.500467,-99) );
// itree = 359
fBoostWeights.push_back(0.0166449);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -2.03677, 1, 1, 0.505275,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455198,-99) ,
12, -1.16502, 0, 0, 0.503395,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508212,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457226,-99) ,
12, 11.3966, 0, 0, 0.484896,-99) ,
8, 0.905056, 0, 0, 0.50172,-99) );
// itree = 360
fBoostWeights.push_back(0.0320354);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 3.40398, 1, 1, 0.533674,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506101,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475947,-99) ,
8, 1.66283, 0, 0, 0.499925,-99) ,
11, 1.23855, 0, 0, 0.504438,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.551395,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489341,-99) ,
8, 1.01211, 0, 0, 0.503445,-99) ,
NN(
0,
0,
-1, 1.20783, 0, -1, 0.468243,-99) ,
11, 5.58205, 0, 0, 0.489437,-99) ,
8, 1.32783, 0, 0, 0.500528,-99) );
// itree = 361
fBoostWeights.push_back(0.0162245);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.498091, 0, 1, 0.527161,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515767,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495583,-99) ,
2, -0.11205, 1, 0, 0.498167,-99) ,
2, 0.214327, 0, 0, 0.499876,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471979,-99) ,
4, 8.96333, 1, 0, 0.498559,-99) );
// itree = 362
fBoostWeights.push_back(0.0233043);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527302,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478066,-99) ,
8, 1.2829, 0, 0, 0.514141,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503621,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486824,-99) ,
12, 1.61676, 0, 0, 0.49708,-99) ,
10, -1.00001, 1, 0, 0.500411,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467189,-99) ,
5, 0.996667, 0, 0, 0.49936,-99) );
// itree = 363
fBoostWeights.push_back(0.0302896);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.94303, 0, 1, 0.513709,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521166,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.428052,-99) ,
11, -2.9284, 1, 0, 0.474477,-99) ,
12, -0.668419, 0, 0, 0.507706,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522891,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496181,-99) ,
8, 2.21578, 0, 0, 0.500065,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509391,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.425405,-99) ,
3, 2.42983, 0, 0, 0.461413,-99) ,
12, 0.723177, 0, 0, 0.494775,-99) ,
10, -0.142883, 1, 0, 0.500718,-99) );
// itree = 364
fBoostWeights.push_back(0.0201626);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.498091, 1, 1, 0.53632,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519758,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496902,-99) ,
8, 2.31047, 0, 0, 0.499992,-99) ,
10, -1.57142, 1, 0, 0.502166,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520445,-99) ,
NN(
0,
0,
-1, -0.440435, 0, -1, 0.464,-99) ,
11, -2.87488, 1, 0, 0.482712,-99) ,
12, -0.227626, 0, 0, 0.499799,-99) );
// itree = 365
fBoostWeights.push_back(0.0276205);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538177,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509522,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4957,-99) ,
8, 1.54488, 0, 0, 0.503422,-99) ,
10, -1.85714, 1, 0, 0.504649,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.56435,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467557,-99) ,
11, -2.57455, 1, 0, 0.494996,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.443989,-99) ,
12, -1.22061, 0, 0, 0.484538,-99) ,
12, -0.0224326, 0, 0, 0.501592,-99) );
// itree = 366
fBoostWeights.push_back(0.00733508);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 9.44673, 0, 1, 0.502245,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476438,-99) ,
8, 0.707117, 0, 0, 0.501286,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471839,-99) ,
10, 2.14283, 1, 0, 0.500546,-99) );
// itree = 367
fBoostWeights.push_back(0.0210614);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530824,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507666,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489575,-99) ,
10, 1.04077, 1, 0, 0.50354,-99) ,
NN(
0,
0,
-1, 0.227239, 1, -1, 0.485751,-99) ,
12, 0.681222, 0, 0, 0.498846,-99) ,
10, -2.14286, 1, 0, 0.499857,-99) );
// itree = 368
fBoostWeights.push_back(0.0125417);
fForest.push_back(
NN(
NN(
0,
0,
-1, 1.42472, 0, 1, 0.522421,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502063,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461354,-99) ,
10, 2.07474, 1, 0, 0.500786,-99) ,
NN(
0,
0,
-1, 1.9063, 1, -1, 0.481374,-99) ,
9, 0.525285, 1, 0, 0.498117,-99) ,
10, -1.85715, 1, 0, 0.499454,-99) );
// itree = 369
fBoostWeights.push_back(0.0255361);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.636791, 1, 1, 0.524511,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507503,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.468084,-99) ,
12, 12.0781, 0, 0, 0.488718,-99) ,
13, 0.872288, 0, 0, 0.509261,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.532518,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495538,-99) ,
6, -0.317965, 1, 0, 0.49948,-99) ,
NN(
0,
0,
-1, 1.4088, 0, -1, 0.468599,-99) ,
8, 1.38761, 0, 0, 0.495658,-99) ,
11, 3.80945, 0, 0, 0.498365,-99) );
// itree = 370
fBoostWeights.push_back(0.033752);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527521,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486952,-99) ,
12, -0.318218, 0, 0, 0.514259,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500108,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.440549,-99) ,
12, 0.778039, 0, 0, 0.490001,-99) ,
10, 0.143034, 1, 0, 0.502798,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536351,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496275,-99) ,
8, 1.22385, 0, 0, 0.503872,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502282,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.426783,-99) ,
11, 0.79767, 0, 0, 0.473597,-99) ,
11, 2.64423, 0, 0, 0.492868,-99) ,
8, 1.5134, 0, 0, 0.499072,-99) );
// itree = 371
fBoostWeights.push_back(0.0226985);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533383,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494256,-99) ,
3, 1.10553, 0, 0, 0.523984,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466424,-99) ,
5, 0.999524, 0, 0, 0.515404,-99) ,
NN(
NN(
0,
0,
-1, 1.13979, 0, 1, 0.510162,-99) ,
NN(
0,
0,
-1, 3.57545, 1, -1, 0.493416,-99) ,
11, 3.54086, 0, 0, 0.497209,-99) ,
10, -1.00001, 1, 0, 0.50074,-99) );
// itree = 372
fBoostWeights.push_back(0.0240461);
fForest.push_back(
NN(
NN(
0,
0,
-1, 2.99382, 1, 1, 0.524625,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523848,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48157,-99) ,
3, 1.07654, 0, 0, 0.514721,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507778,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489757,-99) ,
11, 1.33486, 0, 0, 0.49662,-99) ,
10, -1.2857, 1, 0, 0.499104,-99) ,
3, 2.51743, 0, 0, 0.500772,-99) );
// itree = 373
fBoostWeights.push_back(0.0325163);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515179,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477411,-99) ,
12, -0.718517, 0, 0, 0.510458,-99) ,
NN(
0,
0,
-1, 1.32977, 0, -1, 0.491467,-99) ,
8, 1.53487, 0, 0, 0.5028,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537222,-99) ,
NN(
0,
0,
-1, 1.91255, 1, -1, 0.457733,-99) ,
9, -951.286, 0, 0, 0.485741,-99) ,
10, 1.28563, 1, 0, 0.50081,-99) );
// itree = 374
fBoostWeights.push_back(0.0302812);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.548111,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483093,-99) ,
12, -0.851199, 0, 0, 0.52535,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510744,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45816,-99) ,
11, -0.219213, 0, 0, 0.497446,-99) ,
8, 1.71197, 0, 0, 0.508912,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506146,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491445,-99) ,
10, 0.877544, 1, 0, 0.501025,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470956,-99) ,
12, 0.245683, 0, 0, 0.498377,-99) ,
10, -0.428567, 1, 0, 0.502155,-99) );
// itree = 375
fBoostWeights.push_back(0.0198158);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.561191,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497123,-99) ,
9, -949.657, 1, 0, 0.529666,-99) ,
NN(
0,
0,
-1, 0.498091, 1, -1, 0.497192,-99) ,
11, -1.78193, 1, 0, 0.516671,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534501,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492222,-99) ,
13, 1.4079, 0, 0, 0.515077,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501206,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487998,-99) ,
12, 2.11173, 0, 0, 0.495343,-99) ,
10, -1.28574, 1, 0, 0.498088,-99) ,
3, 2.22638, 0, 0, 0.500571,-99) );
// itree = 376
fBoostWeights.push_back(0.0176241);
fForest.push_back(
NN(
NN(
0,
0,
-1, 2.77943, 0, 1, 0.522616,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533077,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496699,-99) ,
9, -949.96, 0, 0, 0.507177,-99) ,
NN(
0,
0,
-1, 0.516219, 0, -1, 0.493579,-99) ,
10, -0.714317, 1, 0, 0.497279,-99) ,
3, 2.54027, 0, 0, 0.498839,-99) );
// itree = 377
fBoostWeights.push_back(0.0230094);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.558345,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49006,-99) ,
11, -1.72053, 1, 0, 0.529375,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52147,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474472,-99) ,
12, -0.132571, 0, 0, 0.497952,-99) ,
9, -949.657, 1, 0, 0.514987,-99) ,
NN(
NN(
0,
0,
-1, 1.85706, 0, 1, 0.50731,-99) ,
NN(
0,
0,
-1, 1.62304, 0, -1, 0.490738,-99) ,
11, 0.553662, 0, 0, 0.499033,-99) ,
3, 2.20539, 0, 0, 0.501268,-99) );
// itree = 378
fBoostWeights.push_back(0.0216352);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.25926, 0, 1, 0.50972,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.449285,-99) ,
10, 1.85718, 1, 0, 0.506162,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527355,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496863,-99) ,
10, -1.2858, 1, 0, 0.499725,-99) ,
NN(
0,
0,
-1, -1.30759, 1, -1, 0.465168,-99) ,
12, 1.29672, 0, 0, 0.494888,-99) ,
8, 1.71143, 0, 0, 0.500458,-99) );
// itree = 379
fBoostWeights.push_back(0.0244195);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541006,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517559,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490705,-99) ,
8, 1.50956, 0, 0, 0.506822,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501679,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.441073,-99) ,
12, 0.705428, 0, 0, 0.494952,-99) ,
10, 0.0611999, 1, 0, 0.501104,-99) ,
10, -2.14285, 1, 0, 0.502378,-99) );
// itree = 380
fBoostWeights.push_back(0.0251836);
fForest.push_back(
NN(
NN(
0,
0,
-1, -0.278405, 1, 1, 0.529606,-99) ,
NN(
NN(
0,
0,
-1, 2.10388, 0, 1, 0.504171,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528371,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475491,-99) ,
11, -2.184, 1, 0, 0.490161,-99) ,
12, 1.13935, 0, 0, 0.499317,-99) ,
10, -1.85711, 1, 0, 0.500999,-99) );
// itree = 381
fBoostWeights.push_back(0.0298598);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527559,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460369,-99) ,
12, -1.20085, 0, 0, 0.517356,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500279,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463449,-99) ,
6, -0.651895, 1, 0, 0.480051,-99) ,
13, 1.2478, 0, 0, 0.508627,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520536,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.482162,-99) ,
12, -0.158854, 0, 0, 0.509243,-99) ,
NN(
0,
0,
-1, 0.657881, 0, -1, 0.491307,-99) ,
3, 2.20804, 0, 0, 0.494026,-99) ,
10, -0.714295, 1, 0, 0.49797,-99) );
// itree = 382
fBoostWeights.push_back(0.0221473);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.954933, 0, 1, 0.516957,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501247,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.450959,-99) ,
11, 3.59697, 0, 0, 0.48377,-99) ,
3, 1.12027, 0, 0, 0.509392,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528362,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49645,-99) ,
12, 11.1285, 0, 0, 0.498637,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46119,-99) ,
12, 0.136328, 0, 0, 0.495948,-99) ,
10, -0.428544, 1, 0, 0.500775,-99) );
// itree = 383
fBoostWeights.push_back(0.0133442);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537954,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507581,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496843,-99) ,
8, 1.91362, 0, 0, 0.500674,-99) ,
10, -2.14285, 1, 0, 0.50187,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466088,-99) ,
5, 0.996667, 0, 0, 0.500761,-99) );
// itree = 384
fBoostWeights.push_back(0.019689);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.568706,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492357,-99) ,
10, 1.14495, 1, 0, 0.529896,-99) ,
NN(
0,
0,
-1, -1.28565, 1, 1, 0.502752,-99) ,
8, 2.27551, 0, 0, 0.505468,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.547249,-99) ,
NN(
0,
0,
-1, -0.474363, 0, -1, 0.4818,-99) ,
11, -3.02722, 1, 0, 0.491063,-99) ,
12, 0.413866, 0, 0, 0.502242,-99) );
// itree = 385
fBoostWeights.push_back(0.0345114);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529602,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490979,-99) ,
12, -0.260838, 0, 0, 0.516324,-99) ,
NN(
0,
0,
-1, 0.609616, 0, -1, 0.49199,-99) ,
10, 0.143008, 1, 0, 0.504813,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523217,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487434,-99) ,
3, 0.750932, 0, 0, 0.508173,-99) ,
NN(
0,
0,
-1, 1.21344, 0, -1, 0.479188,-99) ,
11, 5.25951, 0, 0, 0.491812,-99) ,
8, 1.5134, 0, 0, 0.499952,-99) );
// itree = 386
fBoostWeights.push_back(0.0225724);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.146133, 1, 1, 0.512597,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507093,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489258,-99) ,
11, 0.763537, 0, 0, 0.498594,-99) ,
8, 2.1833, 0, 0, 0.501823,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515055,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484789,-99) ,
12, 1.82263, 0, 0, 0.501437,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.447295,-99) ,
5, 0.999524, 0, 0, 0.485713,-99) ,
0, 0.492376, 0, 0, 0.500262,-99) );
// itree = 387
fBoostWeights.push_back(0.0154691);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53105,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508007,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495405,-99) ,
8, 1.76251, 0, 0, 0.501088,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467962,-99) ,
12, -1.07662, 0, 0, 0.500009,-99) ,
10, -2.14286, 1, 0, 0.500985,-99) );
// itree = 388
fBoostWeights.push_back(0.0193304);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.8578, 1, 1, 0.507119,-99) ,
NN(
0,
0,
-1, 1.44768, 0, -1, 0.494306,-99) ,
13, 1.46024, 0, 0, 0.502027,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523652,-99) ,
NN(
0,
0,
-1, -0.602084, 1, -1, 0.467483,-99) ,
11, -2.85503, 1, 0, 0.484969,-99) ,
12, -0.129857, 0, 0, 0.49974,-99) );
// itree = 389
fBoostWeights.push_back(0.0339575);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534009,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496608,-99) ,
11, 1.36738, 0, 0, 0.51131,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506639,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464326,-99) ,
11, 6.16217, 0, 0, 0.494217,-99) ,
8, 1.22946, 0, 0, 0.504641,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510376,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475482,-99) ,
8, 1.80263, 0, 0, 0.499667,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.446231,-99) ,
10, 0.775882, 1, 0, 0.494024,-99) ,
12, 1.661, 0, 0, 0.499665,-99) );
// itree = 390
fBoostWeights.push_back(0.0166971);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51285,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49626,-99) ,
11, 1.43398, 0, 0, 0.501203,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472985,-99) ,
13, 0.740528, 0, 0, 0.499744,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461136,-99) ,
5, 0.996191, 0, 0, 0.498721,-99) );
// itree = 391
fBoostWeights.push_back(0.0281531);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.25792, 0, 1, 0.522984,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464482,-99) ,
5, 0.999524, 0, 0, 0.514353,-99) ,
NN(
NN(
0,
0,
-1, 1.84609, 0, 1, 0.505235,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519427,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478133,-99) ,
11, -1.68595, 1, 0, 0.492136,-99) ,
12, 1.58608, 0, 0, 0.500054,-99) ,
10, -1.00001, 1, 0, 0.502825,-99) );
// itree = 392
fBoostWeights.push_back(0.0259018);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.39945, 0, 1, 0.511359,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501697,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4505,-99) ,
12, 6.6991, 0, 0, 0.474301,-99) ,
13, 1.18327, 0, 0, 0.504128,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537812,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495139,-99) ,
8, 2.47062, 0, 0, 0.498412,-99) ,
NN(
0,
0,
-1, 2.34036, 0, -1, 0.456908,-99) ,
12, 0.618904, 0, 0, 0.49344,-99) ,
10, -0.142878, 1, 0, 0.498335,-99) );
// itree = 393
fBoostWeights.push_back(0.0249832);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.559791,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492919,-99) ,
3, 1.15399, 0, 0, 0.527256,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51643,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494413,-99) ,
8, 2.07811, 0, 0, 0.499156,-99) ,
10, -1.28574, 1, 0, 0.501709,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516361,-99) ,
NN(
0,
0,
-1, -0.485276, 0, -1, 0.472133,-99) ,
11, -2.78041, 1, 0, 0.485599,-99) ,
12, 0.00331226, 0, 0, 0.499207,-99) );
// itree = 394
fBoostWeights.push_back(0.026971);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.0527, 1, 1, 0.510267,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500503,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44808,-99) ,
12, 1.98448, 0, 0, 0.495161,-99) ,
13, 1.42262, 0, 0, 0.504325,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.551238,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476189,-99) ,
11, -2.48336, 1, 0, 0.496077,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.449816,-99) ,
12, -1.22948, 0, 0, 0.488685,-99) ,
12, 0.239737, 0, 0, 0.501279,-99) );
// itree = 395
fBoostWeights.push_back(0.0247062);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52835,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506298,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48978,-99) ,
13, 1.2234, 0, 0, 0.501429,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509656,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462882,-99) ,
11, -1.77804, 1, 0, 0.487761,-99) ,
12, 0.817656, 0, 0, 0.497455,-99) ,
10, -2.14285, 1, 0, 0.498425,-99) );
// itree = 396
fBoostWeights.push_back(0.0251571);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524818,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459035,-99) ,
12, -1.0921, 0, 0, 0.513295,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500151,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45999,-99) ,
6, -0.651562, 1, 0, 0.479909,-99) ,
13, 1.21812, 0, 0, 0.506199,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501988,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489635,-99) ,
10, 0.523776, 1, 0, 0.496401,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.468609,-99) ,
12, -0.0515404, 0, 0, 0.494447,-99) ,
10, -0.714307, 1, 0, 0.497623,-99) );
// itree = 397
fBoostWeights.push_back(0.0340639);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.581947,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499827,-99) ,
11, -1.25928, 1, 0, 0.511554,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52642,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491865,-99) ,
10, 1.28521, 0, 0, 0.494928,-99) ,
8, 1.68374, 0, 0, 0.501567,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.594649,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469916,-99) ,
12, -0.492216, 0, 0, 0.505212,-99) ,
NN(
0,
0,
-1, -0.302691, 1, -1, 0.469976,-99) ,
11, -2.13175, 1, 0, 0.487305,-99) ,
12, 0.4216, 0, 0, 0.498342,-99) );
// itree = 398
fBoostWeights.push_back(0.0173699);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512858,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499753,-99) ,
3, 1.41033, 0, 0, 0.506208,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50425,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445391,-99) ,
10, -0.0199124, 1, 0, 0.494579,-99) ,
12, 0.413866, 0, 0, 0.503591,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, -1, 0.499694,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506487,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457539,-99) ,
4, 2.00449, 0, 0, 0.481608,-99) ,
4, 4.48892, 0, 0, 0.486985,-99) ,
0, 0.503804, 1, 0, 0.502114,-99) );
// itree = 399
fBoostWeights.push_back(0.0202142);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.543782,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497322,-99) ,
12, 0.147899, 0, 0, 0.521345,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506317,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486957,-99) ,
3, 0.81145, 0, 0, 0.503748,-99) ,
NN(
0,
0,
-1, 0.367832, 1, -1, 0.486462,-99) ,
12, 1.06286, 0, 0, 0.49801,-99) ,
10, -1.85714, 1, 0, 0.49928,-99) );
// itree = 400
fBoostWeights.push_back(0.0244754);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536786,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496051,-99) ,
3, 1.2702, 0, 0, 0.519064,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504408,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462661,-99) ,
10, 2.12921, 1, 0, 0.502611,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50984,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466664,-99) ,
11, -1.55072, 1, 0, 0.488769,-99) ,
12, 1.2141, 0, 0, 0.497754,-99) ,
10, -1.57138, 1, 0, 0.499608,-99) );
// itree = 401
fBoostWeights.push_back(0.0241059);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.55,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49392,-99) ,
13, 1.48641, 0, 0, 0.518693,-99) ,
NN(
0,
0,
-1, 0.49809, 1, -1, 0.474501,-99) ,
12, -0.748636, 0, 0, 0.509777,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525925,-99) ,
NN(
0,
0,
-1, 0.0237992, 1, -1, 0.494275,-99) ,
12, 10.7039, 0, 0, 0.496384,-99) ,
10, -0.714297, 1, 0, 0.500005,-99) );
// itree = 402
fBoostWeights.push_back(0.0248522);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.547317,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531783,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480801,-99) ,
12, -0.505675, 0, 0, 0.507846,-99) ,
6, -0.458273, 1, 0, 0.51931,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529887,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49904,-99) ,
3, 1.87841, 0, 0, 0.502516,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53367,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48027,-99) ,
11, -2.42904, 1, 0, 0.48967,-99) ,
12, 1.22757, 0, 0, 0.497984,-99) ,
10, -1.57144, 1, 0, 0.499831,-99) );
// itree = 403
fBoostWeights.push_back(0.021151);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.569354,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494206,-99) ,
3, 1.15899, 0, 0, 0.527636,-99) ,
NN(
0,
0,
-1, 9.0694, 0, 1, 0.503244,-99) ,
10, -1.28572, 1, 0, 0.505281,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.544037,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.482233,-99) ,
11, -2.47184, 1, 0, 0.497111,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.448859,-99) ,
12, -1.26746, 0, 0, 0.49089,-99) ,
12, 0.379125, 0, 0, 0.502136,-99) );
// itree = 404
fBoostWeights.push_back(0.00900063);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.039997, 0, 1, 0.531424,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529739,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500305,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466578,-99) ,
12, -0.635923, 0, 0, 0.498655,-99) ,
3, 2.73084, 0, 0, 0.499791,-99) ,
10, -1.85715, 1, 0, 0.501523,-99) );
// itree = 405
fBoostWeights.push_back(0.0239596);
fForest.push_back(
NN(
NN(
0,
0,
-1, -2.18368, 0, 1, 0.52379,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51436,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.458159,-99) ,
10, 1.38096, 1, 0, 0.505829,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502824,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486348,-99) ,
11, 1.53825, 0, 0, 0.493365,-99) ,
8, 2.18328, 0, 0, 0.49633,-99) ,
10, -1.85715, 1, 0, 0.497824,-99) );
// itree = 406
fBoostWeights.push_back(0.0187096);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.25679, 0, 1, 0.520362,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472857,-99) ,
5, 0.999524, 0, 0, 0.51328,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51764,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498203,-99) ,
5, 0.999524, 1, 0, 0.501282,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4584,-99) ,
12, -0.308934, 0, 0, 0.498806,-99) ,
10, -1.00001, 1, 0, 0.501615,-99) );
// itree = 407
fBoostWeights.push_back(0.035124);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513795,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483498,-99) ,
12, -0.304191, 0, 0, 0.50814,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503488,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.430267,-99) ,
12, 2.25249, 0, 0, 0.475317,-99) ,
10, 1.28569, 1, 0, 0.503879,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.539489,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490558,-99) ,
13, 0.913832, 0, 0, 0.507409,-99) ,
NN(
0,
0,
-1, 1.30436, 0, -1, 0.479114,-99) ,
6, -0.603883, 1, 0, 0.491419,-99) ,
13, 1.42262, 0, 0, 0.499879,-99) );
// itree = 408
fBoostWeights.push_back(0.0215427);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.555663,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514123,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492958,-99) ,
0, 0.49809, 0, 0, 0.503733,-99) ,
6, -0.375124, 1, 0, 0.524119,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.539253,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493403,-99) ,
8, 1.13307, 0, 0, 0.506291,-99) ,
NN(
0,
0,
-1, 3.58489, 1, -1, 0.492971,-99) ,
11, 3.07518, 0, 0, 0.496113,-99) ,
10, -1.5714, 1, 0, 0.498557,-99) );
// itree = 409
fBoostWeights.push_back(0.0216462);
fForest.push_back(
NN(
NN(
0,
0,
-1, 2.60437, 0, 1, 0.505566,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.571384,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465673,-99) ,
12, -0.962265, 0, 0, 0.513016,-99) ,
NN(
0,
0,
-1, -0.506643, 1, -1, 0.475933,-99) ,
11, -2.41315, 1, 0, 0.4929,-99) ,
12, 0.0998317, 0, 0, 0.503404,-99) );
// itree = 410
fBoostWeights.push_back(0.0245698);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.830516, 0, 1, 0.515041,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500542,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.456362,-99) ,
12, 4.80205, 0, 0, 0.482789,-99) ,
13, 1.20839, 0, 0, 0.508351,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516148,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494953,-99) ,
11, 5.58674, 0, 0, 0.499203,-99) ,
NN(
0,
0,
-1, 0.101457, 1, -1, 0.465991,-99) ,
12, 0.438655, 0, 0, 0.495299,-99) ,
10, -0.428582, 1, 0, 0.499974,-99) );
// itree = 411
fBoostWeights.push_back(0.0174393);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.563868,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48633,-99) ,
8, 0.724464, 0, 0, 0.520322,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520601,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497864,-99) ,
7, 0.0102002, 0, 0, 0.501568,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462541,-99) ,
7, 0.0238027, 1, 0, 0.499738,-99) ,
12, 9.5102, 0, 0, 0.501199,-99) );
// itree = 412
fBoostWeights.push_back(0.00823253);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524792,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520595,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498666,-99) ,
10, -1.85711, 1, 0, 0.499874,-99) ,
3, 2.69721, 0, 0, 0.500866,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463953,-99) ,
0, 0.489519, 0, 0, 0.499931,-99) );
// itree = 413
fBoostWeights.push_back(0.0324349);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.72221, 0, 1, 0.511992,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511503,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467957,-99) ,
12, 7.34636, 0, 0, 0.485649,-99) ,
13, 1.23796, 0, 0, 0.506054,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524809,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493885,-99) ,
9, -948.526, 0, 0, 0.505082,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44159,-99) ,
12, 1.11009, 0, 0, 0.496095,-99) ,
10, 0.428533, 1, 0, 0.502701,-99) );
// itree = 414
fBoostWeights.push_back(0.0170953);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524514,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513866,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498087,-99) ,
8, 1.7, 0, 0, 0.503575,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502854,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.452113,-99) ,
10, 0.0531132, 1, 0, 0.491616,-99) ,
12, 0.821127, 0, 0, 0.500099,-99) ,
10, -2.14285, 1, 0, 0.500858,-99) );
// itree = 415
fBoostWeights.push_back(0.0192308);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534441,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522734,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499571,-99) ,
10, -1.28569, 1, 0, 0.501607,-99) ,
8, 2.50478, 0, 0, 0.503318,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.557571,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.482106,-99) ,
11, -2.5994, 1, 0, 0.494909,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.444307,-99) ,
12, -1.23115, 0, 0, 0.488101,-99) ,
12, 0.413866, 0, 0, 0.499902,-99) );
// itree = 416
fBoostWeights.push_back(0.0181191);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529932,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50759,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49467,-99) ,
12, 0.867539, 0, 0, 0.504089,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460227,-99) ,
12, -0.933002, 0, 0, 0.502206,-99) ,
10, -2.14286, 1, 0, 0.503072,-99) );
// itree = 417
fBoostWeights.push_back(0.0266369);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.69329, 0, 1, 0.518054,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506308,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480216,-99) ,
11, 5.41507, 0, 0, 0.496075,-99) ,
12, 3.55114, 1, 0, 0.505734,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505162,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.451324,-99) ,
10, 0.991063, 1, 0, 0.500206,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.442329,-99) ,
8, 1.4231, 0, 0, 0.496455,-99) ,
12, 1.95822, 0, 0, 0.500845,-99) );
// itree = 418
fBoostWeights.push_back(0.0334458);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526013,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499847,-99) ,
11, 1.71887, 0, 0, 0.510796,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511866,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445813,-99) ,
12, 7.69333, 0, 0, 0.49368,-99) ,
8, 1.04704, 0, 0, 0.506441,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513225,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479413,-99) ,
8, 1.95889, 0, 0, 0.498349,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.453967,-99) ,
10, 0.775882, 1, 0, 0.493664,-99) ,
12, 1.661, 0, 0, 0.500427,-99) );
// itree = 419
fBoostWeights.push_back(0.0238365);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.934916, 1, 1, 0.524356,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506568,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493617,-99) ,
8, 1.58221, 0, 0, 0.499482,-99) ,
8, 2.39368, 0, 0, 0.50162,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516349,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459365,-99) ,
12, -0.905862, 0, 0, 0.495148,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.448647,-99) ,
10, -0.297074, 1, 0, 0.485691,-99) ,
12, 0.116956, 0, 0, 0.49887,-99) );
// itree = 420
fBoostWeights.push_back(0.0314331);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516381,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495144,-99) ,
11, 1.1847, 0, 0, 0.503072,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503619,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455725,-99) ,
6, -0.801982, 1, 0, 0.479549,-99) ,
13, 0.860159, 0, 0, 0.500677,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.566121,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476402,-99) ,
11, -2.06537, 1, 0, 0.507594,-99) ,
NN(
0,
0,
-1, -2.75435, 1, -1, 0.46546,-99) ,
12, -0.494873, 0, 0, 0.48835,-99) ,
12, 0.239737, 0, 0, 0.498285,-99) );
// itree = 421
fBoostWeights.push_back(0.0162187);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531593,-99) ,
NN(
NN(
0,
0,
-1, -0.999996, 1, 1, 0.505312,-99) ,
NN(
0,
0,
-1, 0.0244435, 1, -1, 0.486264,-99) ,
12, 0.517779, 0, 0, 0.501108,-99) ,
3, 2.71031, 0, 0, 0.502279,-99) );
// itree = 422
fBoostWeights.push_back(0.0142117);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534033,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518465,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496348,-99) ,
10, -1.16325, 1, 0, 0.498765,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471364,-99) ,
12, -0.960835, 0, 0, 0.497642,-99) ,
10, -2.14286, 1, 0, 0.49879,-99) );
// itree = 423
fBoostWeights.push_back(0.0280442);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517356,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481951,-99) ,
12, -0.571745, 0, 0, 0.511083,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461818,-99) ,
10, 1.85718, 1, 0, 0.507904,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505253,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489566,-99) ,
8, 1.10133, 0, 0, 0.500186,-99) ,
NN(
0,
0,
-1, -1.479, 1, -1, 0.465568,-99) ,
12, 0.971159, 0, 0, 0.496393,-99) ,
8, 1.76253, 0, 0, 0.501683,-99) );
// itree = 424
fBoostWeights.push_back(0.00948316);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516703,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500629,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460223,-99) ,
7, 0.0237915, 1, 0, 0.498899,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463629,-99) ,
8, 0.950724, 0, 0, 0.497146,-99) ,
12, 10.5443, 0, 0, 0.498289,-99) );
// itree = 425
fBoostWeights.push_back(0.021329);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.782854, 0, 1, 0.516843,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473376,-99) ,
3, 0.968808, 0, 0, 0.510903,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519026,-99) ,
NN(
0,
0,
-1, 0.0237992, 1, -1, 0.492864,-99) ,
12, 11.1277, 0, 0, 0.494517,-99) ,
10, -0.714295, 1, 0, 0.498936,-99) );
// itree = 426
fBoostWeights.push_back(0.0235663);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.491363, 1, 1, 0.528384,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48857,-99) ,
12, -0.483794, 0, 0, 0.515013,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538409,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493231,-99) ,
8, 1.30988, 0, 0, 0.521893,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504659,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487662,-99) ,
11, 0.554366, 0, 0, 0.496502,-99) ,
10, -1.57145, 1, 0, 0.498847,-99) ,
3, 2.21486, 0, 0, 0.501058,-99) );
// itree = 427
fBoostWeights.push_back(0.00986024);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.85715, 1, 1, 0.502767,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454504,-99) ,
12, -1.21688, 0, 0, 0.501207,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475207,-99) ,
8, 0.710595, 0, 0, 0.500222,-99) );
// itree = 428
fBoostWeights.push_back(0.0277705);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.591145,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523612,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.447755,-99) ,
11, -2.91889, 1, 0, 0.485562,-99) ,
12, -0.527372, 0, 0, 0.515824,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513565,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496691,-99) ,
3, 1.44728, 0, 0, 0.502945,-99) ,
NN(
0,
0,
-1, 0.505442, 1, -1, 0.486112,-99) ,
12, 1.21703, 0, 0, 0.497762,-99) ,
11, -2.17348, 1, 0, 0.499685,-99) );
// itree = 429
fBoostWeights.push_back(0.020052);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.581763,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495449,-99) ,
3, 1.22299, 0, 0, 0.535417,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477534,-99) ,
12, -0.733109, 0, 0, 0.518334,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510393,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495398,-99) ,
8, 1.96268, 0, 0, 0.500186,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467425,-99) ,
12, -0.71111, 0, 0, 0.498705,-99) ,
10, -1.57142, 1, 0, 0.500419,-99) );
// itree = 430
fBoostWeights.push_back(0.011288);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.546531,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501533,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464216,-99) ,
12, -1.07738, 0, 0, 0.499929,-99) ,
12, 8.96105, 0, 0, 0.501985,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476532,-99) ,
8, 0.710595, 0, 0, 0.501,-99) );
// itree = 431
fBoostWeights.push_back(0.013988);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531708,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499875,-99) ,
13, 1.33348, 0, 0, 0.519408,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501973,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488307,-99) ,
12, 0.954833, 0, 0, 0.498062,-99) ,
10, -1.57142, 1, 0, 0.499927,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467876,-99) ,
5, 0.997143, 0, 0, 0.498759,-99) );
// itree = 432
fBoostWeights.push_back(0.0158008);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.539589,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.532772,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486663,-99) ,
11, 0.611261, 0, 0, 0.500824,-99) ,
9, -951.286, 0, 0, 0.511681,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529913,-99) ,
NN(
0,
0,
-1, 0.137416, 0, -1, 0.497276,-99) ,
3, 2.71033, 0, 0, 0.498597,-99) ,
10, -1, 1, 0, 0.501117,-99) );
// itree = 433
fBoostWeights.push_back(0.0361322);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538885,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488587,-99) ,
12, -0.386484, 0, 0, 0.520181,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510651,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.468219,-99) ,
11, 0.587564, 0, 0, 0.49621,-99) ,
13, 1.67792, 0, 0, 0.507235,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53758,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495859,-99) ,
12, 10.3409, 0, 0, 0.49964,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454087,-99) ,
12, 0.827071, 0, 0, 0.494045,-99) ,
10, 0.142855, 1, 0, 0.501466,-99) );
// itree = 434
fBoostWeights.push_back(0.0229382);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.549983,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504556,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467071,-99) ,
12, 3.40613, 1, 0, 0.501657,-99) ,
11, 3.28067, 0, 0, 0.504256,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515568,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483275,-99) ,
13, 0.863285, 0, 0, 0.498484,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.442842,-99) ,
12, 5.09346, 0, 0, 0.490309,-99) ,
13, 1.15614, 0, 0, 0.501714,-99) );
// itree = 435
fBoostWeights.push_back(0.0132393);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.0195908, 0, 1, 0.533055,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51501,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497557,-99) ,
10, -1.2857, 1, 0, 0.499898,-99) ,
2, 0.180175, 0, 0, 0.501803,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463147,-99) ,
2, 0.357034, 1, 0, 0.500771,-99) );
// itree = 436
fBoostWeights.push_back(0.015112);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.673952, 0, 1, 0.524733,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505013,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49332,-99) ,
8, 1.71165, 0, 0, 0.499084,-99) ,
10, -1.85715, 1, 0, 0.500488,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.468267,-99) ,
5, 0.99619, 0, 0, 0.499626,-99) );
// itree = 437
fBoostWeights.push_back(0.0347542);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526007,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491874,-99) ,
9, -951.232, 1, 0, 0.512931,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.567706,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491788,-99) ,
11, -1.5442, 1, 0, 0.499035,-99) ,
11, 2.67531, 0, 0, 0.502997,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520243,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513903,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461393,-99) ,
10, -1.45547, 1, 0, 0.475059,-99) ,
11, -2.7924, 1, 0, 0.489008,-99) ,
12, -0.0224326, 0, 0, 0.500886,-99) );
// itree = 438
fBoostWeights.push_back(0.0184376);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541068,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505479,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48422,-99) ,
3, 1.16681, 0, 0, 0.501645,-99) ,
12, 9.15123, 0, 0, 0.503358,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479897,-99) ,
8, 0.705482, 0, 0, 0.502498,-99) );
// itree = 439
fBoostWeights.push_back(0.0200226);
fForest.push_back(
NN(
NN(
0,
0,
-1, -1.57144, 1, 1, 0.505467,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.55423,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460424,-99) ,
12, -1.10398, 0, 0, 0.505673,-99) ,
NN(
0,
0,
-1, -1.19687, 1, -1, 0.469896,-99) ,
11, -2.52454, 1, 0, 0.487076,-99) ,
12, -0.0983186, 0, 0, 0.502903,-99) );
// itree = 440
fBoostWeights.push_back(0.0312374);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521407,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492504,-99) ,
12, 0.574154, 0, 0, 0.507262,-99) ,
NN(
0,
0,
-1, 0.999525, 0, -1, 0.492773,-99) ,
8, 1.52697, 0, 0, 0.50143,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519657,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521168,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.446057,-99) ,
13, 1.64631, 1, 0, 0.471504,-99) ,
9, -951.218, 0, 0, 0.488974,-99) ,
10, 0.999994, 1, 0, 0.499255,-99) );
// itree = 441
fBoostWeights.push_back(0.0134089);
fForest.push_back(
NN(
NN(
0,
0,
-1, -0.369324, 1, 1, 0.521063,-99) ,
NN(
NN(
0,
0,
-1, 2.30433, 0, 1, 0.50304,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500685,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.447054,-99) ,
10, 0.357258, 1, 0, 0.491046,-99) ,
12, 1.10531, 0, 0, 0.499122,-99) ,
10, -1.57144, 1, 0, 0.501026,-99) );
// itree = 442
fBoostWeights.push_back(0.0185374);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 8.8012, 0, 1, 0.505519,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478129,-99) ,
13, 0.7192, 0, 0, 0.503083,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502544,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463701,-99) ,
8, 1.57315, 0, 0, 0.496941,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.448258,-99) ,
10, 0.861858, 1, 0, 0.492315,-99) ,
12, 1.77676, 0, 0, 0.497772,-99) );
// itree = 443
fBoostWeights.push_back(0.0216139);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515586,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521686,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489031,-99) ,
8, 1.01156, 0, 0, 0.504799,-99) ,
NN(
0,
0,
-1, 3.58573, 1, -1, 0.491388,-99) ,
11, 2.7817, 0, 0, 0.494783,-99) ,
3, 2.5715, 0, 0, 0.49596,-99) );
// itree = 444
fBoostWeights.push_back(0.0126481);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536626,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511511,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496744,-99) ,
10, -1.16322, 1, 0, 0.498673,-99) ,
10, -2.14285, 1, 0, 0.499871,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467987,-99) ,
5, 0.997143, 0, 0, 0.498712,-99) );
// itree = 445
fBoostWeights.push_back(0.0234545);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.741952, 0, 1, 0.514908,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465086,-99) ,
10, 1.57143, 1, 0, 0.509207,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.570247,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495738,-99) ,
10, -0.999962, 1, 0, 0.5069,-99) ,
NN(
0,
0,
-1, 0.999048, 0, -1, 0.491967,-99) ,
9, -948.526, 0, 0, 0.496957,-99) ,
8, 2.18353, 0, 0, 0.499793,-99) );
// itree = 446
fBoostWeights.push_back(0.0179222);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.558509,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498188,-99) ,
8, 0.775089, 0, 0, 0.52007,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503942,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478113,-99) ,
7, 0.00113343, 0, 0, 0.500501,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46231,-99) ,
7, 0.0238027, 1, 0, 0.498688,-99) ,
6, -0.729696, 1, 0, 0.500361,-99) );
// itree = 447
fBoostWeights.push_back(0.0240776);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 4.9867, 1, 1, 0.521517,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506268,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476176,-99) ,
8, 0.966386, 0, 0, 0.495308,-99) ,
9, -43.6462, 1, 0, 0.511453,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.545668,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495009,-99) ,
11, 1.40337, 0, 0, 0.498804,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.441579,-99) ,
12, 3.48539, 1, 0, 0.49651,-99) ,
11, 2.57113, 0, 0, 0.500181,-99) );
// itree = 448
fBoostWeights.push_back(0.00894453);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529934,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.546854,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499933,-99) ,
10, -1.85715, 1, 0, 0.502034,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461587,-99) ,
12, -1.17942, 0, 0, 0.500624,-99) ,
12, 12.6356, 0, 0, 0.501782,-99) );
// itree = 449
fBoostWeights.push_back(0.0161489);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529829,-99) ,
NN(
NN(
0,
0,
-1, 2.30433, 0, 1, 0.505481,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502567,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44824,-99) ,
10, 0.019629, 1, 0, 0.491238,-99) ,
12, 0.668951, 0, 0, 0.50179,-99) ,
10, -2.14286, 1, 0, 0.502652,-99) );
// itree = 450
fBoostWeights.push_back(0.0184655);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.570586,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497296,-99) ,
10, 0.807735, 1, 0, 0.523439,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525023,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499388,-99) ,
10, -1.28574, 1, 0, 0.501846,-99) ,
8, 2.27384, 0, 0, 0.504212,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510461,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.450272,-99) ,
12, -1.22948, 0, 0, 0.498218,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454204,-99) ,
10, -0.280016, 1, 0, 0.488359,-99) ,
12, 0.239737, 0, 0, 0.501163,-99) );
// itree = 451
fBoostWeights.push_back(0.0259522);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533968,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473929,-99) ,
12, -1.01333, 0, 0, 0.520808,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50251,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459503,-99) ,
12, -0.244254, 0, 0, 0.499659,-99) ,
10, -0.714189, 1, 0, 0.505102,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508524,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48987,-99) ,
9, -951.211, 1, 0, 0.501612,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.426972,-99) ,
11, 1.70493, 0, 0, 0.49413,-99) ,
8, 1.34175, 0, 0, 0.502144,-99) );
// itree = 452
fBoostWeights.push_back(0.0130678);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.999047, 1, 1, 0.51849,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521244,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497468,-99) ,
6, -0.730381, 1, 0, 0.499314,-99) ,
2, -0.0919913, 1, 0, 0.501802,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469126,-99) ,
2, -0.357264, 0, 0, 0.50093,-99) );
// itree = 453
fBoostWeights.push_back(0.0181082);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524285,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507982,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495215,-99) ,
8, 1.37138, 0, 0, 0.503147,-99) ,
NN(
0,
0,
-1, 0.0099637, 1, -1, 0.485872,-99) ,
12, 0.517779, 0, 0, 0.499345,-99) ,
3, 2.68255, 0, 0, 0.500384,-99) );
// itree = 454
fBoostWeights.push_back(0.0080172);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.38839, 0, 1, 0.524487,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51941,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49946,-99) ,
5, 0.999048, 1, 0, 0.500962,-99) ,
10, -1.85714, 1, 0, 0.502243,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47034,-99) ,
5, 0.996667, 0, 0, 0.501252,-99) );
// itree = 455
fBoostWeights.push_back(0.025102);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.634169, 1, 1, 0.52513,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514075,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474441,-99) ,
12, 11.9449, 0, 0, 0.49468,-99) ,
13, 0.886676, 0, 0, 0.511274,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505571,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475691,-99) ,
12, -0.705854, 0, 0, 0.502698,-99) ,
NN(
0,
0,
-1, 1.25268, 0, -1, 0.470415,-99) ,
8, 1.38162, 0, 0, 0.498795,-99) ,
11, 3.88413, 0, 0, 0.501261,-99) );
// itree = 456
fBoostWeights.push_back(0.0268481);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531858,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516313,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460783,-99) ,
12, 7.25199, 0, 0, 0.50258,-99) ,
8, 1.07198, 0, 0, 0.510998,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.547112,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495541,-99) ,
11, 1.49894, 0, 0, 0.500381,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457701,-99) ,
12, 3.76076, 1, 0, 0.497691,-99) ,
11, 3.80945, 0, 0, 0.500335,-99) );
// itree = 457
fBoostWeights.push_back(0.0238516);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 8.02536, 0, 1, 0.50815,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474381,-99) ,
3, 0.655288, 0, 0, 0.506753,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528564,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486002,-99) ,
9, -951.286, 0, 0, 0.50092,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.436402,-99) ,
12, 1.59139, 0, 0, 0.490477,-99) ,
10, 0.999955, 1, 0, 0.503905,-99) );
// itree = 458
fBoostWeights.push_back(0.0253982);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.758454, 0, 1, 0.512018,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504459,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.442805,-99) ,
12, 5.40699, 0, 0, 0.479342,-99) ,
13, 1.202, 0, 0, 0.505342,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535362,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496656,-99) ,
12, 11.0287, 0, 0, 0.499704,-99) ,
NN(
0,
0,
-1, -1.87943, 1, -1, 0.455578,-99) ,
12, 0.688856, 0, 0, 0.493983,-99) ,
10, -0.142888, 1, 0, 0.499187,-99) );
// itree = 459
fBoostWeights.push_back(0.0134985);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.0779541, 0, 1, 0.53518,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526256,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497223,-99) ,
10, -1.85716, 1, 0, 0.498824,-99) ,
2, -0.214305, 1, 0, 0.500986,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471694,-99) ,
4, 9.79006, 1, 0, 0.499902,-99) );
// itree = 460
fBoostWeights.push_back(0.021176);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.562868,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49524,-99) ,
13, 0.794954, 0, 0, 0.519823,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516335,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4978,-99) ,
10, -0.428578, 1, 0, 0.504478,-99) ,
NN(
0,
0,
-1, 4.38679, 0, -1, 0.478019,-99) ,
8, 1.2037, 0, 0, 0.501484,-99) ,
12, 8.04958, 0, 0, 0.503252,-99) );
// itree = 461
fBoostWeights.push_back(0.0229105);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.549596,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479766,-99) ,
10, 1.41027, 1, 0, 0.527184,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507067,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496395,-99) ,
12, 1.98445, 0, 0, 0.503141,-99) ,
8, 2.31582, 0, 0, 0.505497,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533056,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501162,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45455,-99) ,
12, -0.437389, 0, 0, 0.483278,-99) ,
11, -2.95098, 1, 0, 0.492671,-99) ,
12, 0.239737, 0, 0, 0.503007,-99) );
// itree = 462
fBoostWeights.push_back(0.0256222);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535696,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504834,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474238,-99) ,
0, 0.505709, 1, 0, 0.503783,-99) ,
8, 2.49986, 0, 0, 0.505698,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.568224,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455991,-99) ,
12, -1.14923, 0, 0, 0.516311,-99) ,
NN(
0,
0,
-1, -0.328804, 1, -1, 0.477348,-99) ,
11, -2.49448, 1, 0, 0.491338,-99) ,
12, 0.26054, 0, 0, 0.502868,-99) );
// itree = 463
fBoostWeights.push_back(0.029604);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.145311, 1, 1, 0.512512,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503488,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.456739,-99) ,
11, 5.30675, 0, 0, 0.494164,-99) ,
8, 1.21217, 0, 0, 0.505633,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51639,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485328,-99) ,
8, 1.98178, 0, 0, 0.501098,-99) ,
NN(
0,
0,
-1, 2.39289, 0, -1, 0.470423,-99) ,
10, 0.51416, 1, 0, 0.49607,-99) ,
12, 1.661, 0, 0, 0.501144,-99) );
// itree = 464
fBoostWeights.push_back(0.0300798);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509607,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479681,-99) ,
12, -0.559712, 0, 0, 0.505428,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512522,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.468755,-99) ,
9, -951.286, 0, 0, 0.484149,-99) ,
10, 1.00002, 1, 0, 0.501494,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514727,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492256,-99) ,
8, 1.02115, 0, 0, 0.500951,-99) ,
NN(
0,
0,
-1, 1.26497, 0, -1, 0.452613,-99) ,
11, 3.29662, 0, 0, 0.489878,-99) ,
8, 1.34175, 0, 0, 0.498368,-99) );
// itree = 465
fBoostWeights.push_back(0.0270654);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.9524, 1, 1, 0.517992,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459804,-99) ,
5, 0.999524, 0, 0, 0.509447,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516323,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4925,-99) ,
8, 1.70324, 0, 0, 0.499938,-99) ,
NN(
0,
0,
-1, 0.606325, 1, -1, 0.485478,-99) ,
12, 1.32619, 0, 0, 0.495033,-99) ,
10, -1.00003, 1, 0, 0.497791,-99) );
// itree = 466
fBoostWeights.push_back(0.0242929);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.552681,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493144,-99) ,
10, 0.718351, 1, 0, 0.531754,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48931,-99) ,
9, -951.218, 1, 0, 0.512313,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509336,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494527,-99) ,
8, 1.66769, 0, 0, 0.499593,-99) ,
NN(
0,
0,
-1, -0.263148, 1, -1, 0.477594,-99) ,
12, 0.758589, 0, 0, 0.494851,-99) ,
3, 2.21486, 0, 0, 0.497231,-99) );
// itree = 467
fBoostWeights.push_back(0.0184193);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.710206, 0, 1, 0.526099,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507411,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495663,-99) ,
11, 2.06122, 0, 0, 0.499739,-99) ,
8, 2.51134, 0, 0, 0.50161,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516773,-99) ,
NN(
0,
0,
-1, -0.584808, 1, -1, 0.473284,-99) ,
11, -2.82831, 1, 0, 0.486919,-99) ,
12, -0.0983186, 0, 0, 0.499558,-99) );
// itree = 468
fBoostWeights.push_back(0.0201606);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.38657, 0, 1, 0.517885,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.544064,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498378,-99) ,
12, 0.626598, 0, 0, 0.513022,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504337,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489204,-99) ,
11, 1.34464, 0, 0, 0.495589,-99) ,
8, 2.34782, 0, 0, 0.498694,-99) ,
10, -1.57143, 1, 0, 0.500343,-99) );
// itree = 469
fBoostWeights.push_back(0.0190121);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.45472, 0, 1, 0.536856,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503595,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469793,-99) ,
4, 9.1556, 1, 0, 0.502059,-99) ,
6, -0.391012, 1, 0, 0.504672,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506953,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483438,-99) ,
3, 0.698963, 0, 0, 0.500997,-99) ,
NN(
0,
0,
-1, 1.25732, 0, -1, 0.459453,-99) ,
11, 3.13824, 0, 0, 0.492424,-99) ,
8, 1.33598, 0, 0, 0.501408,-99) );
// itree = 470
fBoostWeights.push_back(0.0228224);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525876,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497959,-99) ,
12, 1.25926, 0, 0, 0.506497,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465062,-99) ,
10, 1.85714, 1, 0, 0.503941,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536796,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496847,-99) ,
13, 0.817644, 0, 0, 0.511849,-99) ,
NN(
0,
0,
-1, 0.593787, 0, -1, 0.489139,-99) ,
6, -0.669568, 1, 0, 0.493884,-99) ,
8, 1.71534, 0, 0, 0.498821,-99) );
// itree = 471
fBoostWeights.push_back(0.0300711);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529039,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461764,-99) ,
12, -1.16194, 0, 0, 0.517387,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512734,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49399,-99) ,
11, 0.765049, 0, 0, 0.498713,-99) ,
10, -0.714219, 1, 0, 0.503485,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511581,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478209,-99) ,
5, 0.999982, 0, 0, 0.495994,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.456053,-99) ,
5, 0.999624, 0, 0, 0.492168,-99) ,
8, 1.34175, 0, 0, 0.500426,-99) );
// itree = 472
fBoostWeights.push_back(0.0400679);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.545253,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461146,-99) ,
10, 1.28636, 1, 0, 0.528776,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508216,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466862,-99) ,
12, -0.3251, 0, 0, 0.493243,-99) ,
9, -12.1436, 1, 0, 0.513334,-99) ,
NN(
NN(
0,
0,
-1, -1.00021, 1, 1, 0.513205,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508872,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473873,-99) ,
11, 0.769723, 0, 0, 0.491646,-99) ,
9, -1.69972, 0, 0, 0.498433,-99) ,
8, 2.15556, 0, 0, 0.502057,-99) );
// itree = 473
fBoostWeights.push_back(0.0299594);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512843,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474743,-99) ,
12, -0.892489, 0, 0, 0.509039,-99) ,
NN(
0,
0,
-1, 2.2722, 0, -1, 0.477906,-99) ,
10, 1.28578, 1, 0, 0.504734,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520004,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506231,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483983,-99) ,
12, 9.61647, 0, 0, 0.488218,-99) ,
10, -1.85718, 1, 0, 0.490907,-99) ,
8, 1.54513, 0, 0, 0.499237,-99) );
// itree = 474
fBoostWeights.push_back(0.0238737);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.02365, 0, 1, 0.51494,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472946,-99) ,
10, 1.57143, 1, 0, 0.510059,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529008,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507467,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490295,-99) ,
12, 8.06812, 0, 0, 0.492539,-99) ,
10, -1.85714, 1, 0, 0.494786,-99) ,
8, 2.18347, 0, 0, 0.498291,-99) );
// itree = 475
fBoostWeights.push_back(0.0157166);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533234,-99) ,
NN(
NN(
0,
0,
-1, 0.386378, 1, 1, 0.514719,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501564,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489198,-99) ,
10, 0.0611776, 1, 0, 0.495732,-99) ,
3, 2.2528, 0, 0, 0.498158,-99) ,
10, -2.14286, 1, 0, 0.499246,-99) );
// itree = 476
fBoostWeights.push_back(0.0224532);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.46158, 0, 1, 0.504966,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501393,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44695,-99) ,
12, 1.44819, 0, 0, 0.48784,-99) ,
10, 0.428583, 1, 0, 0.499144,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513612,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474802,-99) ,
13, 0.782322, 0, 0, 0.496505,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.43338,-99) ,
12, 5.75776, 0, 0, 0.485968,-99) ,
13, 1.11852, 0, 0, 0.496946,-99) );
// itree = 477
fBoostWeights.push_back(0.035878);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.575747,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485841,-99) ,
10, 1.58043, 1, 0, 0.536039,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513577,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44837,-99) ,
10, 0.335061, 1, 0, 0.496759,-99) ,
12, 0.991328, 0, 0, 0.506982,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.575846,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491739,-99) ,
10, -0.996689, 1, 0, 0.50419,-99) ,
NN(
0,
0,
-1, 0.999048, 0, -1, 0.487985,-99) ,
9, -1.58995, 0, 0, 0.493024,-99) ,
8, 2.14237, 0, 0, 0.496494,-99) );
// itree = 478
fBoostWeights.push_back(0.0200617);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529125,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504669,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49259,-99) ,
10, 0.42856, 1, 0, 0.500129,-99) ,
8, 2.60405, 0, 0, 0.501614,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512777,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472478,-99) ,
12, -0.771356, 0, 0, 0.494422,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.446221,-99) ,
10, -0.28187, 1, 0, 0.485468,-99) ,
12, 0.0623895, 0, 0, 0.498949,-99) );
// itree = 479
fBoostWeights.push_back(0.025583);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.768075, 0, 1, 0.528128,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505825,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491384,-99) ,
8, 1.26384, 0, 0, 0.501675,-99) ,
8, 2.50477, 0, 0, 0.503536,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.547727,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465675,-99) ,
12, -1.04947, 0, 0, 0.503563,-99) ,
NN(
0,
0,
-1, -0.770565, 1, -1, 0.462316,-99) ,
11, -2.49292, 1, 0, 0.48145,-99) ,
12, -0.0224326, 0, 0, 0.500209,-99) );
// itree = 480
fBoostWeights.push_back(0.020691);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526941,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508789,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495588,-99) ,
8, 1.71063, 0, 0, 0.500875,-99) ,
10, -1.57143, 1, 0, 0.502226,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509702,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479326,-99) ,
12, -0.513797, 0, 0, 0.495628,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.444751,-99) ,
10, -0.0199487, 1, 0, 0.487465,-99) ,
12, 0.400445, 0, 0, 0.498965,-99) );
// itree = 481
fBoostWeights.push_back(0.01721);
fForest.push_back(
NN(
NN(
0,
0,
-1, 1.25702, 0, 1, 0.523963,-99) ,
NN(
NN(
0,
0,
-1, 2.27358, 0, 1, 0.503208,-99) ,
NN(
0,
0,
-1, 0.206778, 1, -1, 0.485229,-99) ,
12, 1.15298, 0, 0, 0.497109,-99) ,
10, -1.5714, 1, 0, 0.499459,-99) );
// itree = 482
fBoostWeights.push_back(0.0297794);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 4.26781, 1, 1, 0.5171,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510202,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476821,-99) ,
11, 6.31001, 0, 0, 0.490894,-99) ,
9, -951.227, 1, 0, 0.507212,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508809,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488141,-99) ,
10, 0.142965, 1, 0, 0.49962,-99) ,
NN(
0,
0,
-1, 1.23839, 0, -1, 0.455457,-99) ,
8, 1.47168, 0, 0, 0.494902,-99) ,
11, 1.72205, 0, 0, 0.498594,-99) );
// itree = 483
fBoostWeights.push_back(0.0156508);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523802,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53663,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497038,-99) ,
8, 2.5554, 0, 0, 0.498538,-99) ,
NN(
0,
0,
-1, -0.561498, 1, -1, 0.477857,-99) ,
12, 0.179724, 0, 0, 0.495186,-99) ,
3, 2.68748, 0, 0, 0.496361,-99) );
// itree = 484
fBoostWeights.push_back(0.0232512);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534346,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516541,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498784,-99) ,
10, -1.2857, 1, 0, 0.500339,-99) ,
8, 2.50493, 0, 0, 0.502127,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.582449,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472185,-99) ,
12, -0.513888, 0, 0, 0.505127,-99) ,
NN(
0,
0,
-1, -0.302706, 1, -1, 0.46855,-99) ,
11, -2.12878, 1, 0, 0.486774,-99) ,
12, 0.400445, 0, 0, 0.498743,-99) );
// itree = 485
fBoostWeights.push_back(0.0259715);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.59431, 0, 1, 0.509408,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512945,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465318,-99) ,
10, 0.140513, 0, 0, 0.486164,-99) ,
3, 0.81144, 0, 0, 0.505691,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507349,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481701,-99) ,
8, 1.82434, 0, 0, 0.499309,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.456516,-99) ,
10, 0.725571, 1, 0, 0.49473,-99) ,
12, 1.55032, 0, 0, 0.500779,-99) );
// itree = 486
fBoostWeights.push_back(0.0193285);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.543151,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497558,-99) ,
10, 0.908592, 1, 0, 0.517292,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507336,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49556,-99) ,
11, 2.4729, 0, 0, 0.499461,-99) ,
8, 2.39368, 0, 0, 0.501,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522114,-99) ,
NN(
0,
0,
-1, -0.419139, 1, -1, 0.475002,-99) ,
11, -2.93034, 1, 0, 0.485351,-99) ,
12, 0.0998317, 0, 0, 0.498349,-99) );
// itree = 487
fBoostWeights.push_back(0.0212746);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.554699,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49573,-99) ,
10, 0.728141, 1, 0, 0.516689,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503298,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49187,-99) ,
12, 1.78123, 0, 0, 0.499516,-99) ,
8, 2.31598, 0, 0, 0.501334,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519425,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470932,-99) ,
3, 1.81979, 0, 0, 0.501017,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45809,-99) ,
10, -0.617678, 1, 0, 0.486334,-99) ,
12, 0.0998317, 0, 0, 0.498762,-99) );
// itree = 488
fBoostWeights.push_back(0.0236239);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.627238, 1, 1, 0.51067,-99) ,
NN(
0,
0,
-1, 0.259046, 1, -1, 0.490859,-99) ,
12, 0.902623, 0, 0, 0.503332,-99) ,
NN(
NN(
0,
0,
-1, 0.498087, 1, 1, 0.507442,-99) ,
NN(
0,
0,
-1, 7.29929, 0, -1, 0.467422,-99) ,
6, -0.75088, 1, 0, 0.484948,-99) ,
3, 0.978057, 0, 0, 0.500596,-99) );
// itree = 489
fBoostWeights.push_back(0.0243744);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541692,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505894,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488626,-99) ,
12, 0.62067, 0, 0, 0.49916,-99) ,
6, -0.38198, 1, 0, 0.501554,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510166,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465773,-99) ,
5, 0.999905, 0, 0, 0.501055,-99) ,
NN(
0,
0,
-1, 1.67911, 0, -1, 0.481102,-99) ,
6, -0.55672, 1, 0, 0.491349,-99) ,
13, 1.42262, 0, 0, 0.498273,-99) );
// itree = 490
fBoostWeights.push_back(0.0208652);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.524518, 1, 1, 0.519539,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512207,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47668,-99) ,
3, 1.04633, 0, 0, 0.505253,-99) ,
NN(
0,
0,
-1, 0.828151, 0, -1, 0.493182,-99) ,
10, -0.428591, 1, 0, 0.497583,-99) ,
3, 2.41215, 0, 0, 0.499468,-99) );
// itree = 491
fBoostWeights.push_back(0.0188139);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.540383,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520815,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492008,-99) ,
3, 2.70808, 0, 0, 0.503647,-99) ,
6, 0.377062, 1, 0, 0.515279,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526212,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470109,-99) ,
3, 1.08452, 0, 0, 0.513107,-99) ,
NN(
0,
0,
-1, 0.0803387, 0, -1, 0.495458,-99) ,
10, -1.28574, 1, 0, 0.497889,-99) ,
3, 2.2528, 0, 0, 0.500054,-99) );
// itree = 492
fBoostWeights.push_back(0.00695675);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531877,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526726,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500239,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46649,-99) ,
12, -0.835001, 0, 0, 0.498957,-99) ,
3, 2.68748, 0, 0, 0.500122,-99) ,
10, -2.14285, 1, 0, 0.501116,-99) );
// itree = 493
fBoostWeights.push_back(0.02318);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530394,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511257,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489681,-99) ,
12, 0.583746, 0, 0, 0.502879,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503249,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484834,-99) ,
10, 0.305991, 0, 0, 0.49106,-99) ,
8, 1.55213, 0, 0, 0.49822,-99) ,
10, -2.14285, 1, 0, 0.499213,-99) );
// itree = 494
fBoostWeights.push_back(0.0268481);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.80612, 0, 1, 0.5129,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500637,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.443812,-99) ,
12, 6.75376, 0, 0, 0.476758,-99) ,
8, 1.10596, 0, 0, 0.507287,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521421,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493842,-99) ,
13, 2.18246, 0, 0, 0.498235,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503392,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.428736,-99) ,
11, -1.86076, 1, 0, 0.464362,-99) ,
12, 0.674024, 0, 0, 0.493968,-99) ,
10, -0.142888, 1, 0, 0.500076,-99) );
// itree = 495
fBoostWeights.push_back(0.00969044);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528082,-99) ,
NN(
NN(
0,
0,
-1, 2.43569, 0, 1, 0.502018,-99) ,
NN(
0,
0,
-1, -0.00453225, 1, -1, 0.489206,-99) ,
12, 0.515272, 0, 0, 0.499183,-99) ,
3, 2.73085, 0, 0, 0.500244,-99) );
// itree = 496
fBoostWeights.push_back(0.0153369);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 7.30219, 0, 1, 0.502676,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460043,-99) ,
13, 0.72797, 0, 0, 0.50065,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524544,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494631,-99) ,
11, 7.7606, 0, 0, 0.499694,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.437088,-99) ,
12, 1.40049, 0, 0, 0.489658,-99) ,
10, 0.714251, 1, 0, 0.4979,-99) );
// itree = 497
fBoostWeights.push_back(0.0387019);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517506,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49039,-99) ,
9, -949.135, 1, 0, 0.506691,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457425,-99) ,
10, 1.85717, 1, 0, 0.503617,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517332,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492361,-99) ,
8, 1.20958, 0, 0, 0.501482,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531578,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459791,-99) ,
9, -951.286, 0, 0, 0.478553,-99) ,
11, 1.56921, 0, 0, 0.492014,-99) ,
8, 1.74165, 0, 0, 0.497503,-99) );
// itree = 498
fBoostWeights.push_back(0.0269249);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528697,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515736,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459163,-99) ,
12, 8.54175, 0, 0, 0.497417,-99) ,
8, 1.01074, 0, 0, 0.508092,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541377,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495473,-99) ,
11, 1.40908, 0, 0, 0.499399,-99) ,
NN(
0,
0,
-1, 2.79406, 0, -1, 0.461976,-99) ,
12, 3.5276, 1, 0, 0.495683,-99) ,
11, 4.29333, 0, 0, 0.498,-99) );
// itree = 499
fBoostWeights.push_back(0.0207418);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.577669,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498854,-99) ,
10, 0.127747, 1, 0, 0.513714,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516201,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495857,-99) ,
10, -1.00018, 1, 0, 0.499437,-99) ,
8, 1.97292, 0, 0, 0.502821,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522788,-99) ,
NN(
0,
0,
-1, -0.787371, 0, -1, 0.481298,-99) ,
11, -2.93034, 1, 0, 0.490397,-99) ,
12, 0.0998317, 0, 0, 0.500701,-99) );
// itree = 500
fBoostWeights.push_back(0.0288675);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.563689,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506843,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466772,-99) ,
8, 1.48051, 0, 0, 0.502418,-99) ,
11, 1.65162, 0, 0, 0.506182,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.543563,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496193,-99) ,
13, 0.987193, 0, 0, 0.508094,-99) ,
NN(
0,
0,
-1, 2.67561, 0, -1, 0.475387,-99) ,
11, 5.59935, 0, 0, 0.494731,-99) ,
12, 3.54503, 1, 0, 0.503155,-99) );
// itree = 501
fBoostWeights.push_back(0.0197189);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527072,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509108,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496986,-99) ,
11, 1.07922, 0, 0, 0.502442,-99) ,
8, 2.60405, 0, 0, 0.503801,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528433,-99) ,
NN(
0,
0,
-1, -0.819798, 0, -1, 0.472784,-99) ,
11, -3.00294, 1, 0, 0.485591,-99) ,
12, -0.0685417, 0, 0, 0.501211,-99) );
// itree = 502
fBoostWeights.push_back(0.0168803);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.556819,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.482673,-99) ,
4, 5.14657, 1, 0, 0.523194,-99) ,
NN(
NN(
0,
0,
-1, -0.72968, 1, 1, 0.502959,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518728,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483801,-99) ,
2, -0.112257, 1, 0, 0.490157,-99) ,
0, 0.500947, 1, 0, 0.499898,-99) ,
2, 0.214104, 0, 0, 0.501471,-99) );
// itree = 503
fBoostWeights.push_back(0.00864289);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526963,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535169,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499422,-99) ,
10, -1.85716, 1, 0, 0.500954,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463988,-99) ,
12, -1.03053, 0, 0, 0.499344,-99) ,
12, 13.4227, 0, 0, 0.500267,-99) );
// itree = 504
fBoostWeights.push_back(0.0208188);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.98977, 1, 1, 0.527195,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507289,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495621,-99) ,
8, 1.65352, 0, 0, 0.500578,-99) ,
8, 2.51851, 0, 0, 0.502449,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528294,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473866,-99) ,
11, -2.36939, 1, 0, 0.49755,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459589,-99) ,
12, -1.10365, 0, 0, 0.487299,-99) ,
12, -0.0983186, 0, 0, 0.500341,-99) );
// itree = 505
fBoostWeights.push_back(0.00882069);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524397,-99) ,
NN(
NN(
0,
0,
-1, 7.72995, 0, 1, 0.502515,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466442,-99) ,
11, 12.8849, 1, 0, 0.501176,-99) ,
12, 13.1857, 0, 0, 0.502008,-99) );
// itree = 506
fBoostWeights.push_back(0.0177915);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522945,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50597,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48009,-99) ,
12, -0.620387, 0, 0, 0.502839,-99) ,
NN(
0,
0,
-1, 1.16266, 0, -1, 0.490885,-99) ,
10, 0.428509, 1, 0, 0.498862,-99) ,
12, 11.3601, 0, 0, 0.500087,-99) );
// itree = 507
fBoostWeights.push_back(0.0225363);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.544471,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510654,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487879,-99) ,
13, 0.764244, 0, 0, 0.504546,-99) ,
8, 1.28292, 0, 0, 0.510181,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528398,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495399,-99) ,
11, 1.05646, 0, 0, 0.499526,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.439382,-99) ,
12, 3.47253, 1, 0, 0.496996,-99) ,
11, 2.61286, 0, 0, 0.500221,-99) );
// itree = 508
fBoostWeights.push_back(0.0293263);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.890673, 1, 1, 0.529305,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511436,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.451625,-99) ,
10, 0.125962, 1, 0, 0.495979,-99) ,
12, 0.807672, 0, 0, 0.508465,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533202,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528795,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492858,-99) ,
10, 1.61168, 0, 0, 0.494907,-99) ,
10, -1.85727, 1, 0, 0.497455,-99) ,
8, 1.97301, 0, 0, 0.501078,-99) );
// itree = 509
fBoostWeights.push_back(0.0142337);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.545126,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493978,-99) ,
13, 0.787034, 0, 0, 0.515577,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533527,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498664,-99) ,
11, 2.90814, 0, 0, 0.500883,-99) ,
NN(
0,
0,
-1, 5.21524, 0, -1, 0.476301,-99) ,
8, 1.18073, 0, 0, 0.498562,-99) ,
12, 7.67087, 0, 0, 0.500352,-99) );
// itree = 510
fBoostWeights.push_back(0.0321428);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534071,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459295,-99) ,
12, -1.2029, 0, 0, 0.521693,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509025,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486059,-99) ,
12, 1.05908, 0, 0, 0.501068,-99) ,
10, -0.714189, 1, 0, 0.50633,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538791,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499953,-99) ,
3, 0.937913, 0, 0, 0.508036,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500521,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445979,-99) ,
11, 2.52583, 0, 0, 0.47916,-99) ,
11, 5.58205, 0, 0, 0.496116,-99) ,
8, 1.34177, 0, 0, 0.503583,-99) );
// itree = 511
fBoostWeights.push_back(0.0169478);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53122,-99) ,
NN(
NN(
0,
0,
-1, 8.13668, 0, 1, 0.50542,-99) ,
NN(
0,
0,
-1, 1.42979, 0, -1, 0.486709,-99) ,
10, 0.714245, 1, 0, 0.500841,-99) ,
12, 11.8098, 0, 0, 0.502275,-99) );
// itree = 512
fBoostWeights.push_back(0.0141169);
fForest.push_back(
NN(
NN(
0,
0,
-1, 2.38038, 0, 1, 0.505218,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515605,-99) ,
NN(
0,
0,
-1, -0.818405, 1, -1, 0.480666,-99) ,
3, 2.54017, 0, 0, 0.489248,-99) ,
12, -0.0983186, 0, 0, 0.502991,-99) );
// itree = 513
fBoostWeights.push_back(0.0144918);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525464,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518293,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499463,-99) ,
10, -0.999906, 1, 0, 0.502792,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503507,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460123,-99) ,
11, 3.39754, 0, 0, 0.490108,-99) ,
8, 1.35649, 0, 0, 0.49971,-99) ,
12, 11.8098, 0, 0, 0.500897,-99) );
// itree = 514
fBoostWeights.push_back(0.0237885);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.570493,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495464,-99) ,
11, -1.4092, 1, 0, 0.511992,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512745,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496374,-99) ,
12, 8.26282, 0, 0, 0.498918,-99) ,
8, 1.89997, 0, 0, 0.502495,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515012,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469395,-99) ,
12, -0.84017, 0, 0, 0.496955,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461414,-99) ,
10, -0.351319, 1, 0, 0.488476,-99) ,
12, 0.18073, 0, 0, 0.499928,-99) );
// itree = 515
fBoostWeights.push_back(0.0146337);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.546845,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491916,-99) ,
4, 5.21832, 1, 0, 0.521912,-99) ,
NN(
NN(
0,
0,
-1, 2.3302, 0, 1, 0.505122,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500416,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.448507,-99) ,
10, -0.000714143, 1, 0, 0.492695,-99) ,
12, 0.379125, 0, 0, 0.502429,-99) ,
2, 0.214088, 0, 0, 0.503728,-99) );
// itree = 516
fBoostWeights.push_back(0.0185042);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.569052,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480313,-99) ,
12, -0.843655, 0, 0, 0.518768,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524357,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50156,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48626,-99) ,
12, 1.21703, 0, 0, 0.497075,-99) ,
8, 2.66764, 0, 0, 0.49841,-99) ,
11, -2.29409, 1, 0, 0.500259,-99) );
// itree = 517
fBoostWeights.push_back(0.0252968);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52313,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490184,-99) ,
12, -0.350515, 0, 0, 0.51244,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502602,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46713,-99) ,
12, 0.548752, 0, 0, 0.497381,-99) ,
10, -0.142772, 1, 0, 0.50397,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527102,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49899,-99) ,
12, 13.442, 0, 0, 0.502632,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.439952,-99) ,
11, 1.96437, 0, 0, 0.492169,-99) ,
13, 1.38903, 0, 0, 0.50042,-99) );
// itree = 518
fBoostWeights.push_back(0.0156747);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.23917, 0, 1, 0.512508,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517698,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495626,-99) ,
10, -1.53061, 1, 0, 0.497914,-99) ,
8, 2.1833, 0, 0, 0.501198,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470506,-99) ,
10, 2.14283, 1, 0, 0.500421,-99) );
// itree = 519
fBoostWeights.push_back(0.00801528);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.999524, 1, 1, 0.502375,-99) ,
NN(
0,
0,
-1, 0.107128, 0, -1, 0.483362,-99) ,
0, 0.490879, 0, 0, 0.50129,-99) ,
NN(
0,
0,
-1, 0.506117, 1, -1, 0.482736,-99) ,
0, 0.504757, 1, 0, 0.500211,-99) );
// itree = 520
fBoostWeights.push_back(0.0123692);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.31971, 0, 1, 0.511367,-99) ,
NN(
0,
0,
-1, 0.998572, 0, -1, 0.496356,-99) ,
8, 2.15576, 0, 0, 0.499919,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466407,-99) ,
10, 2.1428, 1, 0, 0.499077,-99) );
// itree = 521
fBoostWeights.push_back(0.0269439);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.39663, 1, 1, 0.508296,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503149,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485238,-99) ,
6, -0.560524, 1, 0, 0.494477,-99) ,
13, 1.42262, 0, 0, 0.502674,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.571222,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478758,-99) ,
12, -0.514007, 0, 0, 0.506541,-99) ,
NN(
0,
0,
-1, -0.305382, 1, -1, 0.474174,-99) ,
11, -2.12445, 1, 0, 0.490545,-99) ,
12, 0.400445, 0, 0, 0.500003,-99) );
// itree = 522
fBoostWeights.push_back(0.0233466);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.85743, 1, 1, 0.505688,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.453469,-99) ,
5, 0.999163, 0, 0, 0.502985,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52063,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489552,-99) ,
12, 1.19748, 0, 0, 0.498214,-99) ,
NN(
0,
0,
-1, 0.161483, 1, -1, 0.470889,-99) ,
3, 1.71615, 0, 0, 0.491591,-99) ,
6, -0.00941309, 1, 0, 0.498254,-99) );
// itree = 523
fBoostWeights.push_back(0.0304915);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.563802,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507552,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465448,-99) ,
10, -0.486751, 1, 0, 0.492721,-99) ,
12, 0.371292, 0, 0, 0.507608,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.565956,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496774,-99) ,
5, 0.999524, 1, 0, 0.506039,-99) ,
NN(
0,
0,
-1, 0.998572, 0, -1, 0.488824,-99) ,
9, -951.206, 0, 0, 0.494652,-99) ,
11, -1.22553, 1, 0, 0.497918,-99) );
// itree = 524
fBoostWeights.push_back(0.0157359);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535194,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495597,-99) ,
6, 0.567697, 1, 0, 0.517783,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502315,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487821,-99) ,
12, 0.250545, 0, 0, 0.499801,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514376,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466749,-99) ,
9, -951.286, 0, 0, 0.48319,-99) ,
10, 1.28564, 1, 0, 0.497932,-99) ,
3, 2.41216, 0, 0, 0.499627,-99) );
// itree = 525
fBoostWeights.push_back(0.0260304);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536336,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483225,-99) ,
12, -0.981899, 0, 0, 0.523074,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477933,-99) ,
13, 1.24316, 0, 0, 0.512433,-99) ,
NN(
NN(
0,
0,
-1, 0.333198, 1, 1, 0.520447,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504137,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488558,-99) ,
11, 0.744867, 0, 0, 0.496046,-99) ,
3, 2.39455, 0, 0, 0.498351,-99) ,
10, -1.00003, 1, 0, 0.501079,-99) );
// itree = 526
fBoostWeights.push_back(0.0338652);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518723,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493788,-99) ,
12, -0.185855, 0, 0, 0.510624,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506021,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457435,-99) ,
12, 1.41081, 0, 0, 0.491366,-99) ,
10, 0.428656, 1, 0, 0.503363,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511477,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481491,-99) ,
13, 0.782461, 0, 0, 0.504889,-99) ,
NN(
0,
0,
-1, 2.29829, 1, -1, 0.46575,-99) ,
11, 1.83592, 0, 0, 0.493724,-99) ,
8, 1.53506, 0, 0, 0.499618,-99) );
// itree = 527
fBoostWeights.push_back(0.0302957);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.15762, 0, 1, 0.515979,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.453513,-99) ,
10, 1.57148, 1, 0, 0.508808,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.565652,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493126,-99) ,
10, -1.00039, 1, 0, 0.504062,-99) ,
NN(
0,
0,
-1, 0.999048, 0, -1, 0.487975,-99) ,
9, -948.526, 0, 0, 0.493309,-99) ,
13, 2.01591, 0, 0, 0.498009,-99) );
// itree = 528
fBoostWeights.push_back(0.0237296);
fForest.push_back(
NN(
NN(
0,
0,
-1, 4.96657, 1, 1, 0.521545,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510986,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474022,-99) ,
8, 1.12135, 0, 0, 0.505087,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533256,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491578,-99) ,
12, 11.4109, 0, 0, 0.494134,-99) ,
10, -0.428577, 1, 0, 0.498049,-99) ,
2, 0.214212, 0, 0, 0.499614,-99) );
// itree = 529
fBoostWeights.push_back(0.022513);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.21835, 0, 1, 0.511121,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531449,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492205,-99) ,
10, -1.97961, 1, 0, 0.494506,-99) ,
8, 1.96268, 0, 0, 0.499767,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50751,-99) ,
NN(
0,
0,
-1, 1.69381, 1, -1, 0.469999,-99) ,
9, -951.286, 0, 0, 0.483075,-99) ,
10, 1.28564, 1, 0, 0.497798,-99) );
// itree = 530
fBoostWeights.push_back(0.0122448);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.3158, 0, 1, 0.503131,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505889,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47366,-99) ,
11, -2.26808, 1, 0, 0.490392,-99) ,
12, 0.160852, 0, 0, 0.500777,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.468183,-99) ,
10, 2.14283, 1, 0, 0.499955,-99) );
// itree = 531
fBoostWeights.push_back(0.0144);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 5.94851, 0, 1, 0.502991,-99) ,
NN(
0,
0,
-1, -0.791136, 1, -1, 0.483702,-99) ,
8, 0.90588, 0, 0, 0.501182,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517875,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492168,-99) ,
9, -948.526, 0, 0, 0.501296,-99) ,
NN(
0,
0,
-1, 2.23789, 0, -1, 0.459729,-99) ,
11, 0.150365, 0, 0, 0.487247,-99) ,
10, 0.99998, 1, 0, 0.498744,-99) );
// itree = 532
fBoostWeights.push_back(0.0175301);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505897,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494043,-99) ,
5, 0.999932, 0, 0, 0.501664,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503488,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.440299,-99) ,
0, 0.496185, 0, 0, 0.478206,-99) ,
5, 0.998572, 0, 0, 0.499955,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504239,-99) ,
NN(
0,
0,
-1, -0.00562689, 0, -1, 0.472541,-99) ,
10, -0.140911, 1, 0, 0.485744,-99) ,
9, 0.525285, 1, 0, 0.498065,-99) );
// itree = 533
fBoostWeights.push_back(0.0213242);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53455,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507991,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495491,-99) ,
13, 1.6088, 0, 0, 0.501041,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513878,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472859,-99) ,
11, -2.27963, 1, 0, 0.488064,-99) ,
12, 0.546641, 0, 0, 0.497966,-99) ,
10, -2.14286, 1, 0, 0.499114,-99) );
// itree = 534
fBoostWeights.push_back(0.0180875);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524777,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50372,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479509,-99) ,
12, -0.372926, 0, 0, 0.500255,-99) ,
NN(
0,
0,
-1, 1.55135, 0, -1, 0.484619,-99) ,
10, 0.714244, 1, 0, 0.496394,-99) ,
12, 12.6599, 0, 0, 0.497496,-99) );
// itree = 535
fBoostWeights.push_back(0.0105784);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534745,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494958,-99) ,
10, 0.141802, 0, 0, 0.512507,-99) ,
NN(
0,
0,
-1, 0.0237973, 1, -1, 0.496541,-99) ,
6, -0.729336, 1, 0, 0.4978,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470554,-99) ,
2, -0.357162, 0, 0, 0.497063,-99) );
// itree = 536
fBoostWeights.push_back(0.0302935);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -951.286, 0, 1, 0.513084,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511985,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486133,-99) ,
11, 5.70791, 0, 0, 0.498961,-99) ,
12, 3.0548, 1, 0, 0.504328,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518394,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489277,-99) ,
10, -0.713991, 1, 0, 0.497645,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.424001,-99) ,
13, 1.55794, 0, 0, 0.492488,-99) ,
11, 0.108592, 0, 0, 0.498477,-99) );
// itree = 537
fBoostWeights.push_back(0.0217594);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514538,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480751,-99) ,
8, 1.12093, 0, 0, 0.509247,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514083,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495352,-99) ,
8, 2.3939, 0, 0, 0.498342,-99) ,
10, -0.551022, 1, 0, 0.502262,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508422,-99) ,
NN(
0,
0,
-1, 0.169078, 1, -1, 0.470922,-99) ,
9, -951.286, 0, 0, 0.484118,-99) ,
10, 1.28568, 1, 0, 0.500144,-99) );
// itree = 538
fBoostWeights.push_back(0.023622);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52831,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509076,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494865,-99) ,
11, 2.40444, 0, 0, 0.499458,-99) ,
8, 2.66764, 0, 0, 0.50069,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536153,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472448,-99) ,
11, -2.55517, 1, 0, 0.489465,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.447948,-99) ,
12, -1.26469, 0, 0, 0.482424,-99) ,
12, 0.0997583, 0, 0, 0.497585,-99) );
// itree = 539
fBoostWeights.push_back(0.0218207);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.58661, 1, 1, 0.506058,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500417,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472372,-99) ,
11, 4.44304, 0, 0, 0.491705,-99) ,
13, 1.32543, 0, 0, 0.501596,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541154,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474539,-99) ,
11, -2.54534, 1, 0, 0.494619,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454927,-99) ,
12, -1.22061, 0, 0, 0.486341,-99) ,
12, -0.0224326, 0, 0, 0.499295,-99) );
// itree = 540
fBoostWeights.push_back(0.0209268);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.39087, 1, 1, 0.506912,-99) ,
NN(
0,
0,
-1, 2.8327, 0, -1, 0.49028,-99) ,
8, 1.28862, 0, 0, 0.502083,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522772,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484713,-99) ,
12, -0.351841, 0, 0, 0.497075,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.451782,-99) ,
10, -0.229311, 1, 0, 0.488846,-99) ,
12, 0.14394, 0, 0, 0.499753,-99) );
// itree = 541
fBoostWeights.push_back(0.0228248);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 9.18238, 0, 1, 0.51497,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484279,-99) ,
13, 0.731269, 0, 0, 0.509352,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509376,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493481,-99) ,
12, 1.32006, 0, 0, 0.500237,-99) ,
NN(
0,
0,
-1, 0.848591, 0, -1, 0.469007,-99) ,
8, 1.42712, 0, 0, 0.497069,-99) ,
11, 2.29227, 0, 0, 0.500296,-99) );
// itree = 542
fBoostWeights.push_back(0.0111471);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534755,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501018,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489688,-99) ,
12, 0.821127, 0, 0, 0.497768,-99) ,
10, -2.14285, 1, 0, 0.498922,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460028,-99) ,
2, -0.357184, 0, 0, 0.497909,-99) );
// itree = 543
fBoostWeights.push_back(0.0138969);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.837776, 0, 1, 0.51417,-99) ,
NN(
0,
0,
-1, 0.918299, 1, -1, 0.495449,-99) ,
8, 2.39366, 0, 0, 0.498296,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.456908,-99) ,
10, 2.14277, 1, 0, 0.497253,-99) );
// itree = 544
fBoostWeights.push_back(0.0218809);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.2676, 0, 1, 0.51278,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51676,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492835,-99) ,
12, 6.69509, 0, 0, 0.497063,-99) ,
8, 1.9038, 0, 0, 0.50247,-99) ,
NN(
0,
0,
-1, 1.53014, 0, -1, 0.485649,-99) ,
10, 0.999984, 1, 0, 0.499508,-99) );
// itree = 545
fBoostWeights.push_back(0.00609981);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 8.68407, 0, 1, 0.501278,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473252,-99) ,
3, 0.657881, 0, 0, 0.500268,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470109,-99) ,
1, 0.023789, 1, 0, 0.499338,-99) );
// itree = 546
fBoostWeights.push_back(0.00863013);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52335,-99) ,
NN(
NN(
0,
0,
-1, 2.50478, 0, 1, 0.501436,-99) ,
NN(
0,
0,
-1, 0.32182, 1, -1, 0.490668,-99) ,
12, 0.821127, 0, 0, 0.498325,-99) ,
10, -2.14286, 1, 0, 0.499086,-99) );
// itree = 547
fBoostWeights.push_back(0.0141039);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.43186, 0, 1, 0.519856,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515603,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496622,-99) ,
5, 0.999547, 1, 0, 0.499062,-99) ,
10, -1.57143, 1, 0, 0.500862,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474857,-99) ,
5, 0.997619, 0, 0, 0.499745,-99) );
// itree = 548
fBoostWeights.push_back(0.0193298);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.554176,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49205,-99) ,
9, -949.113, 0, 0, 0.515803,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528649,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495419,-99) ,
10, -1.85713, 1, 0, 0.497243,-99) ,
5, 0.999524, 1, 0, 0.500251,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475388,-99) ,
4, 9.79756, 1, 0, 0.499343,-99) );
// itree = 549
fBoostWeights.push_back(0.0281642);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521033,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487644,-99) ,
12, -0.540594, 0, 0, 0.513965,-99) ,
NN(
0,
0,
-1, 6.96592, 0, -1, 0.476175,-99) ,
8, 1.10805, 0, 0, 0.508191,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505432,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488455,-99) ,
10, 1.20406, 1, 0, 0.500838,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473655,-99) ,
12, 0.557772, 0, 0, 0.497929,-99) ,
10, -0.14287, 1, 0, 0.502634,-99) );
// itree = 550
fBoostWeights.push_back(0.0232921);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.86794, 1, 1, 0.525968,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503829,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487874,-99) ,
11, -1.18508, 1, 0, 0.496393,-99) ,
11, -1.90857, 1, 0, 0.512939,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528343,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487601,-99) ,
3, 1.32699, 0, 0, 0.508767,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503826,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487548,-99) ,
11, 0.853588, 0, 0, 0.495498,-99) ,
10, -1.00002, 1, 0, 0.498131,-99) ,
3, 2.23667, 0, 0, 0.500052,-99) );
// itree = 551
fBoostWeights.push_back(0.0134408);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.292583, 0, 1, 0.524096,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494314,-99) ,
11, -1.53593, 1, 0, 0.514945,-99) ,
NN(
NN(
0,
0,
-1, 1.85705, 0, 1, 0.502976,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500458,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45877,-99) ,
8, 1.64212, 0, 0, 0.493349,-99) ,
11, 0.338529, 0, 0, 0.498464,-99) ,
3, 2.2528, 0, 0, 0.500515,-99) );
// itree = 552
fBoostWeights.push_back(0.0244575);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.21924, 0, 1, 0.508121,-99) ,
NN(
0,
0,
-1, 5.55429, 0, -1, 0.481532,-99) ,
13, 1.22713, 0, 0, 0.50231,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516665,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494371,-99) ,
8, 2.07654, 0, 0, 0.499065,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506882,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.404684,-99) ,
11, -1.63048, 1, 0, 0.453472,-99) ,
12, 0.961583, 0, 0, 0.492358,-99) ,
10, 0.142848, 1, 0, 0.497953,-99) );
// itree = 553
fBoostWeights.push_back(0.0191685);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537567,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510607,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47762,-99) ,
12, 7.03682, 0, 0, 0.501703,-99) ,
8, 1.12409, 0, 0, 0.508456,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50206,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481954,-99) ,
12, -0.315384, 0, 0, 0.498915,-99) ,
NN(
0,
0,
-1, 1.25212, 0, -1, 0.47317,-99) ,
8, 1.39206, 0, 0, 0.495526,-99) ,
11, 4.02185, 0, 0, 0.498035,-99) );
// itree = 554
fBoostWeights.push_back(0.0176354);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.141433, 1, 1, 0.518793,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504029,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462118,-99) ,
12, 7.98596, 0, 0, 0.490553,-99) ,
8, 1.05643, 0, 0, 0.503755,-99) ,
NN(
0,
0,
-1, 1.33078, 0, -1, 0.493988,-99) ,
11, 2.32414, 0, 0, 0.496545,-99) );
// itree = 555
fBoostWeights.push_back(0.0272897);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -2.15675, 0, 1, 0.538719,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498998,-99) ,
3, 1.2478, 0, 0, 0.52241,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520098,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492868,-99) ,
13, 1.76963, 0, 0, 0.504049,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537438,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488822,-99) ,
12, 11.0892, 0, 0, 0.492115,-99) ,
10, -0.0476604, 1, 0, 0.497433,-99) ,
10, -1.57144, 1, 0, 0.499593,-99) );
// itree = 556
fBoostWeights.push_back(0.0144219);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.04439, 1, 1, 0.503826,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479724,-99) ,
8, 0.700177, 0, 0, 0.502764,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524228,-99) ,
NN(
0,
0,
-1, -0.437389, 0, -1, 0.48306,-99) ,
11, -2.96512, 1, 0, 0.490505,-99) ,
12, 0.239737, 0, 0, 0.500385,-99) );
// itree = 557
fBoostWeights.push_back(0.0224314);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -2.01861, 1, 1, 0.509795,-99) ,
NN(
0,
0,
-1, 0.479371, 1, -1, 0.484152,-99) ,
12, -0.512413, 0, 0, 0.505314,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504728,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489457,-99) ,
9, -43.22, 1, 0, 0.499382,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523234,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455007,-99) ,
11, -0.353074, 0, 0, 0.476374,-99) ,
12, 1.29672, 0, 0, 0.495892,-99) ,
8, 1.75366, 0, 0, 0.500282,-99) );
// itree = 558
fBoostWeights.push_back(0.0151215);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517987,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506622,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493992,-99) ,
11, 2.7817, 0, 0, 0.497184,-99) ,
3, 2.53123, 0, 0, 0.498497,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475222,-99) ,
4, 9.78684, 1, 0, 0.497649,-99) );
// itree = 559
fBoostWeights.push_back(0.00919392);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 4.48392, 1, 1, 0.531016,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500376,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485229,-99) ,
9, 0.525285, 1, 0, 0.498372,-99) ,
2, 0.180158, 0, 0, 0.500237,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471494,-99) ,
2, 0.356993, 1, 0, 0.499447,-99) );
// itree = 560
fBoostWeights.push_back(0.0235775);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.723806, 0, 1, 0.508793,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501761,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.453536,-99) ,
12, 7.52578, 0, 0, 0.479553,-99) ,
3, 0.958538, 0, 0, 0.504703,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525979,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512141,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48849,-99) ,
8, 2.49247, 0, 0, 0.49221,-99) ,
12, 10.3025, 0, 0, 0.494797,-99) ,
10, -0.142888, 1, 0, 0.499324,-99) );
// itree = 561
fBoostWeights.push_back(0.0232861);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525435,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511725,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489642,-99) ,
8, 1.24494, 0, 0, 0.502058,-99) ,
NN(
0,
0,
-1, 1.28539, 1, -1, 0.488895,-99) ,
11, 0.156891, 0, 0, 0.495672,-99) ,
3, 2.73084, 0, 0, 0.496763,-99) );
// itree = 562
fBoostWeights.push_back(0.020497);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528575,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5098,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48976,-99) ,
10, 0.551007, 1, 0, 0.502959,-99) ,
NN(
0,
0,
-1, 2.13355, 0, -1, 0.490745,-99) ,
13, 1.55976, 0, 0, 0.498028,-99) ,
10, -2.14286, 1, 0, 0.498961,-99) );
// itree = 563
fBoostWeights.push_back(0.0132964);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.501899, 0, 1, 0.511465,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502519,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492511,-99) ,
2, -0.0035273, 1, 0, 0.49802,-99) ,
2, 0.071281, 0, 0, 0.500368,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466841,-99) ,
5, 0.996191, 0, 0, 0.499478,-99) );
// itree = 564
fBoostWeights.push_back(0.0250883);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53077,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530096,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487028,-99) ,
12, 1.89073, 0, 0, 0.497916,-99) ,
9, -949.96, 0, 0, 0.507093,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524116,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469052,-99) ,
12, -0.452148, 0, 0, 0.51092,-99) ,
NN(
0,
0,
-1, 0.704012, 0, -1, 0.492515,-99) ,
8, 2.39368, 0, 0, 0.495562,-99) ,
10, -1.00001, 1, 0, 0.497782,-99) );
// itree = 565
fBoostWeights.push_back(0.0311375);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53287,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499032,-99) ,
11, 3.34975, 0, 0, 0.52183,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514048,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473074,-99) ,
6, -0.779296, 1, 0, 0.494931,-99) ,
13, 0.906111, 0, 0, 0.512538,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515671,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493656,-99) ,
12, 0.742767, 0, 0, 0.505023,-99) ,
NN(
0,
0,
-1, 0.354565, 0, -1, 0.48123,-99) ,
8, 1.65852, 0, 0, 0.498407,-99) ,
11, 2.10924, 0, 0, 0.502276,-99) );
// itree = 566
fBoostWeights.push_back(0.0157601);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.585883,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475844,-99) ,
9, -949.113, 0, 0, 0.518779,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.547356,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498957,-99) ,
10, -2.14284, 1, 0, 0.500483,-99) ,
5, 0.999048, 1, 0, 0.502384,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478865,-99) ,
4, 9.13827, 1, 0, 0.501324,-99) );
// itree = 567
fBoostWeights.push_back(0.014987);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.21211, 0, 1, 0.50632,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472793,-99) ,
3, 0.656946, 0, 0, 0.505115,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478641,-99) ,
1, 0.0242548, 1, 0, 0.504333,-99) );
// itree = 568
fBoostWeights.push_back(0.0231399);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526344,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479295,-99) ,
12, -1.02752, 0, 0, 0.517299,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5021,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459234,-99) ,
11, 4.0685, 0, 0, 0.483974,-99) ,
3, 1.11609, 0, 0, 0.50961,-99) ,
NN(
NN(
0,
0,
-1, 1.84062, 0, 1, 0.506273,-99) ,
NN(
0,
0,
-1, 1.15472, 1, -1, 0.491787,-99) ,
12, 1.89627, 0, 0, 0.499906,-99) ,
10, -0.714289, 1, 0, 0.502508,-99) );
// itree = 569
fBoostWeights.push_back(0.0128136);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.77623, 0, 1, 0.504455,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471882,-99) ,
7, 0.0237902, 1, 0, 0.503049,-99) ,
NN(
0,
0,
-1, 11.1856, 0, -1, 0.485394,-99) ,
13, 0.927754, 0, 0, 0.50125,-99) );
// itree = 570
fBoostWeights.push_back(0.0234426);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.518445, 0, 1, 0.514032,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513957,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49242,-99) ,
9, -1.26137, 0, 0, 0.498676,-99) ,
3, 1.89488, 0, 0, 0.502438,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526556,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495943,-99) ,
8, 2.2738, 0, 0, 0.500254,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.433128,-99) ,
12, 1.29114, 0, 0, 0.491278,-99) ,
10, 0.714268, 1, 0, 0.49965,-99) );
// itree = 571
fBoostWeights.push_back(0.0270037);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 4.64864, 1, 1, 0.511901,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.554161,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495965,-99) ,
11, -1.46659, 1, 0, 0.50134,-99) ,
11, 2.75009, 0, 0, 0.504348,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.547582,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475951,-99) ,
11, -2.55346, 1, 0, 0.495349,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454495,-99) ,
12, -1.24812, 0, 0, 0.488195,-99) ,
12, 0.0849659, 0, 0, 0.501656,-99) );
// itree = 572
fBoostWeights.push_back(0.017585);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.564653,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494599,-99) ,
3, 1.15545, 0, 0, 0.53381,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493141,-99) ,
12, -0.694591, 0, 0, 0.521315,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512498,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496812,-99) ,
8, 1.97292, 0, 0, 0.50205,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472024,-99) ,
10, 2.12916, 1, 0, 0.501219,-99) ,
10, -1.57145, 1, 0, 0.502956,-99) );
// itree = 573
fBoostWeights.push_back(0.0198265);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508427,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492997,-99) ,
8, 1.21585, 0, 0, 0.50502,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471939,-99) ,
6, 0.61406, 1, 0, 0.503558,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460968,-99) ,
5, 0.996667, 0, 0, 0.502257,-99) );
// itree = 574
fBoostWeights.push_back(0.0142447);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525661,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525542,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498456,-99) ,
11, -1.31734, 1, 0, 0.502239,-99) ,
NN(
0,
0,
-1, -0.65918, 1, -1, 0.482464,-99) ,
12, -0.245245, 0, 0, 0.499793,-99) ,
12, 13.2243, 0, 0, 0.500684,-99) );
// itree = 575
fBoostWeights.push_back(0.0172331);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.214287, 0, 1, 0.505177,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520653,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48082,-99) ,
12, -0.659878, 0, 0, 0.501928,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465133,-99) ,
10, -0.279995, 1, 0, 0.493788,-99) ,
12, 0.222023, 0, 0, 0.503011,-99) );
// itree = 576
fBoostWeights.push_back(0.00873267);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 4.44339, 1, 1, 0.523422,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510079,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498251,-99) ,
2, 0.139599, 0, 0, 0.499646,-99) ,
2, -0.1804, 1, 0, 0.500942,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477201,-99) ,
2, -0.357266, 0, 0, 0.500307,-99) );
// itree = 577
fBoostWeights.push_back(0.0160017);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.01591, 0, 1, 0.505334,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510429,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478384,-99) ,
11, -2.29908, 1, 0, 0.493364,-99) ,
12, 0.239737, 0, 0, 0.502974,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473276,-99) ,
10, 2.14283, 1, 0, 0.502222,-99) );
// itree = 578
fBoostWeights.push_back(0.0234493);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.104835, 1, 1, 0.514458,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50607,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476155,-99) ,
11, 4.71021, 0, 0, 0.495937,-99) ,
3, 1.23759, 0, 0, 0.504734,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534116,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496695,-99) ,
11, 0.0784558, 0, 0, 0.499772,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44589,-99) ,
10, 0.902565, 1, 0, 0.494897,-99) ,
12, 1.80379, 0, 0, 0.499855,-99) );
// itree = 579
fBoostWeights.push_back(0.0191524);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537219,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507868,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462549,-99) ,
10, 1.77552, 1, 0, 0.504517,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501289,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485924,-99) ,
11, 2.22965, 0, 0, 0.49382,-99) ,
8, 1.75368, 0, 0, 0.498864,-99) ,
10, -2.14283, 1, 0, 0.500031,-99) );
// itree = 580
fBoostWeights.push_back(0.0231987);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.544827,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529487,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486491,-99) ,
10, -1.61224, 0, 0, 0.502552,-99) ,
9, -949.657, 0, 0, 0.513532,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519973,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495539,-99) ,
3, 1.60516, 0, 0, 0.501438,-99) ,
NN(
0,
0,
-1, 0.673523, 1, -1, 0.488585,-99) ,
12, 1.42489, 0, 0, 0.496595,-99) ,
10, -1.2857, 1, 0, 0.498815,-99) );
// itree = 581
fBoostWeights.push_back(0.00808889);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 8.87647, 0, 1, 0.502186,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474798,-99) ,
8, 0.710625, 0, 0, 0.501142,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474624,-99) ,
0, 0.490471, 0, 0, 0.499977,-99) );
// itree = 582
fBoostWeights.push_back(0.0213106);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.9236, 0, 1, 0.508442,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504171,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466104,-99) ,
12, 7.17474, 0, 0, 0.486814,-99) ,
8, 1.12093, 0, 0, 0.504908,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52899,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497052,-99) ,
6, -0.731396, 1, 0, 0.499969,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502277,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.413787,-99) ,
8, 2.6908, 0, 0, 0.455562,-99) ,
12, 0.978704, 0, 0, 0.493281,-99) ,
10, 0.142805, 1, 0, 0.499798,-99) );
// itree = 583
fBoostWeights.push_back(0.0147054);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525589,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503865,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475128,-99) ,
8, 0.697147, 0, 0, 0.502476,-99) ,
NN(
0,
0,
-1, 0.227258, 1, -1, 0.487906,-99) ,
12, 0.681222, 0, 0, 0.498663,-99) ,
10, -2.14285, 1, 0, 0.499497,-99) );
// itree = 584
fBoostWeights.push_back(0.0230043);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529829,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493645,-99) ,
3, 1.25775, 0, 0, 0.51562,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471335,-99) ,
5, 0.999524, 0, 0, 0.509218,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510616,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492646,-99) ,
12, 3.50268, 1, 0, 0.500883,-99) ,
NN(
0,
0,
-1, 0.835147, 1, -1, 0.490671,-99) ,
12, 1.8339, 0, 0, 0.496349,-99) ,
10, -1.00001, 1, 0, 0.498817,-99) );
// itree = 585
fBoostWeights.push_back(0.0216419);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523619,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469107,-99) ,
12, -1.14942, 0, 0, 0.515474,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48425,-99) ,
8, 1.10647, 0, 0, 0.510897,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538215,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49655,-99) ,
3, 0.915473, 0, 0, 0.508428,-99) ,
NN(
0,
0,
-1, 3.51503, 1, -1, 0.495329,-99) ,
11, 5.52985, 0, 0, 0.497632,-99) ,
10, -0.714326, 1, 0, 0.501197,-99) );
// itree = 586
fBoostWeights.push_back(0.0232765);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -2.13416, 1, 1, 0.510649,-99) ,
NN(
0,
0,
-1, -949.657, 1, -1, 0.476826,-99) ,
12, -0.602448, 0, 0, 0.505441,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506532,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487308,-99) ,
6, -0.328954, 1, 0, 0.499418,-99) ,
NN(
0,
0,
-1, 1.26199, 0, -1, 0.471239,-99) ,
5, 0.999524, 0, 0, 0.496654,-99) ,
8, 1.73183, 0, 0, 0.500868,-99) );
// itree = 587
fBoostWeights.push_back(0.0180794);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -2.22785, 1, 1, 0.519742,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503807,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485363,-99) ,
12, 0.5886, 0, 0, 0.499975,-99) ,
3, 2.41215, 0, 0, 0.501658,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518014,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491735,-99) ,
5, 0.999977, 0, 0, 0.501154,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454933,-99) ,
5, 0.999524, 0, 0, 0.488874,-99) ,
0, 0.493328, 0, 0, 0.499923,-99) );
// itree = 588
fBoostWeights.push_back(0.0234389);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.12239, 0, 1, 0.512695,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508112,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490222,-99) ,
11, 1.8323, 0, 0, 0.49773,-99) ,
13, 1.89509, 0, 0, 0.502866,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510973,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488264,-99) ,
9, -951.286, 0, 0, 0.496134,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44659,-99) ,
12, 1.58512, 0, 0, 0.48814,-99) ,
10, 0.999955, 1, 0, 0.500267,-99) );
// itree = 589
fBoostWeights.push_back(0.0172689);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524699,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508698,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494445,-99) ,
13, 1.46846, 0, 0, 0.501808,-99) ,
NN(
0,
0,
-1, 0.321812, 1, -1, 0.489658,-99) ,
12, 0.884696, 0, 0, 0.498157,-99) ,
10, -2.14286, 1, 0, 0.498966,-99) );
// itree = 590
fBoostWeights.push_back(0.0194738);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 6.55101, 0, 1, 0.505172,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459528,-99) ,
13, 0.74553, 0, 0, 0.502763,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506083,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488612,-99) ,
10, 1.40814, 1, 0, 0.500353,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.440224,-99) ,
12, 1.11095, 0, 0, 0.492056,-99) ,
10, 0.428555, 1, 0, 0.499129,-99) );
// itree = 591
fBoostWeights.push_back(0.0217033);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.543974,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522386,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497118,-99) ,
11, 0.719693, 0, 0, 0.500495,-99) ,
6, -0.344693, 1, 0, 0.503393,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537016,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493472,-99) ,
12, 4.64864, 1, 0, 0.500446,-99) ,
NN(
0,
0,
-1, 1.27189, 0, -1, 0.474187,-99) ,
11, 2.7636, 0, 0, 0.491901,-99) ,
13, 1.46024, 0, 0, 0.499398,-99) );
// itree = 592
fBoostWeights.push_back(0.0184399);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.460094, 0, 1, 0.512534,-99) ,
NN(
0,
0,
-1, -0.695456, 1, -1, 0.482286,-99) ,
8, 1.12093, 0, 0, 0.507735,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516427,-99) ,
NN(
0,
0,
-1, 0.0238027, 1, -1, 0.493893,-99) ,
12, 10.0581, 0, 0, 0.495665,-99) ,
10, -0.428607, 1, 0, 0.499978,-99) );
// itree = 593
fBoostWeights.push_back(0.0172109);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528226,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516739,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496801,-99) ,
11, 1.65308, 0, 0, 0.50163,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512392,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471247,-99) ,
12, 13.3451, 0, 0, 0.486948,-99) ,
8, 0.905437, 0, 0, 0.50026,-99) ,
10, -2.14283, 1, 0, 0.50113,-99) );
// itree = 594
fBoostWeights.push_back(0.0255538);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.26213, 0, 1, 0.511164,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506395,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470283,-99) ,
11, 1.83403, 0, 0, 0.495932,-99) ,
8, 1.51253, 0, 0, 0.505277,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503877,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502551,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.439407,-99) ,
12, 2.22056, 0, 0, 0.467952,-99) ,
13, 1.90998, 1, 0, 0.485891,-99) ,
10, 1.2857, 1, 0, 0.503013,-99) );
// itree = 595
fBoostWeights.push_back(0.0270917);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530531,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478024,-99) ,
12, -1.13864, 0, 0, 0.519235,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501341,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470965,-99) ,
12, -0.356583, 0, 0, 0.499256,-99) ,
10, -0.999951, 1, 0, 0.502966,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519542,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529628,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462838,-99) ,
7, 0.00453149, 1, 0, 0.484443,-99) ,
7, 0.0237903, 0, 0, 0.489988,-99) ,
3, 1.13743, 0, 0, 0.499996,-99) );
// itree = 596
fBoostWeights.push_back(0.0228734);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.077443, 1, 1, 0.531575,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490496,-99) ,
13, 1.33861, 0, 0, 0.516358,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511829,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.441045,-99) ,
10, 1.69386, 1, 0, 0.504734,-99) ,
NN(
0,
0,
-1, 0.35318, 0, -1, 0.492601,-99) ,
13, 2.00101, 0, 0, 0.496467,-99) ,
10, -1.57142, 1, 0, 0.498169,-99) );
// itree = 597
fBoostWeights.push_back(0.0190724);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 6.36211, 0, 1, 0.504758,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471635,-99) ,
11, 13.6022, 1, 0, 0.502758,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525194,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491987,-99) ,
8, 2.30455, 0, 0, 0.496499,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.436863,-99) ,
12, 0.957184, 0, 0, 0.490041,-99) ,
10, 0.428541, 1, 0, 0.498444,-99) );
// itree = 598
fBoostWeights.push_back(0.0241053);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.585827,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494318,-99) ,
11, -1.79241, 1, 0, 0.51107,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51119,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492928,-99) ,
10, -1.00003, 1, 0, 0.496127,-99) ,
13, 2.0469, 0, 0, 0.499321,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502978,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514557,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462337,-99) ,
10, -1.3762, 1, 0, 0.478128,-99) ,
11, -2.84881, 1, 0, 0.485839,-99) ,
12, -0.129857, 0, 0, 0.497494,-99) );
// itree = 599
fBoostWeights.push_back(0.0266386);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.574909,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499681,-99) ,
10, 0.103542, 1, 0, 0.518622,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492306,-99) ,
12, -0.487318, 0, 0, 0.510787,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508498,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492498,-99) ,
8, 1.25401, 0, 0, 0.501981,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538988,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479563,-99) ,
12, 1.50623, 0, 0, 0.485573,-99) ,
11, -0.18745, 0, 0, 0.496577,-99) ,
3, 2.07879, 0, 0, 0.499198,-99) );
// itree = 600
fBoostWeights.push_back(0.0233736);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535812,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494704,-99) ,
11, -1.58413, 1, 0, 0.518404,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507669,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.482544,-99) ,
12, -0.0596559, 0, 0, 0.495261,-99) ,
9, -949.96, 1, 0, 0.508152,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525363,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49703,-99) ,
8, 1.04423, 0, 0, 0.508265,-99) ,
NN(
0,
0,
-1, 1.27824, 0, -1, 0.490335,-99) ,
11, 3.14834, 0, 0, 0.495215,-99) ,
3, 2.09346, 0, 0, 0.497511,-99) );
// itree = 601
fBoostWeights.push_back(0.00842937);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525137,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517645,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499362,-99) ,
10, -1.57143, 1, 0, 0.50095,-99) ,
3, 2.73085, 0, 0, 0.501831,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504718,-99) ,
NN(
0,
0,
-1, 1.63821, 0, -1, 0.477895,-99) ,
4, 4.63219, 0, 0, 0.485492,-99) ,
0, 0.503804, 1, 0, 0.500383,-99) );
// itree = 602
fBoostWeights.push_back(0.0166468);
fForest.push_back(
NN(
NN(
0,
0,
-1, 2.6698, 0, 1, 0.505431,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.532621,-99) ,
NN(
0,
0,
-1, -0.00074633, 1, -1, 0.484092,-99) ,
11, -3.00359, 1, 0, 0.491239,-99) ,
12, 0.413866, 0, 0, 0.502258,-99) );
// itree = 603
fBoostWeights.push_back(0.0232695);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 5.44574, 1, 1, 0.527842,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513855,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473361,-99) ,
12, 10.1897, 0, 0, 0.496003,-99) ,
8, 0.973185, 0, 0, 0.510371,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.563353,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497184,-99) ,
11, 1.78368, 0, 0, 0.500496,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457467,-99) ,
12, 3.562, 1, 0, 0.497275,-99) ,
11, 3.63558, 0, 0, 0.499989,-99) );
// itree = 604
fBoostWeights.push_back(0.0269734);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523705,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49224,-99) ,
9, -1.26137, 1, 0, 0.51255,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46905,-99) ,
10, 1.85717, 1, 0, 0.509881,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51338,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49637,-99) ,
8, 1.43885, 0, 0, 0.502138,-99) ,
NN(
0,
0,
-1, 1.50135, 0, -1, 0.470828,-99) ,
6, 0.0118431, 1, 0, 0.499107,-99) ,
3, 1.60517, 0, 0, 0.503961,-99) );
// itree = 605
fBoostWeights.push_back(0.0131127);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.80942, 0, 1, 0.523842,-99) ,
NN(
NN(
0,
0,
-1, 5.42987, 0, 1, 0.503418,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461642,-99) ,
8, 1.01077, 0, 0, 0.50183,-99) ,
12, 8.13697, 0, 0, 0.503915,-99) );
// itree = 606
fBoostWeights.push_back(0.0131932);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.554532,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496053,-99) ,
13, 0.78586, 0, 0, 0.517929,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519326,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498492,-99) ,
11, -1.86648, 1, 0, 0.501222,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46553,-99) ,
12, -1.20236, 0, 0, 0.499977,-99) ,
12, 8.11233, 0, 0, 0.501662,-99) );
// itree = 607
fBoostWeights.push_back(0.0209579);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.531139, 1, 1, 0.542545,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51557,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481113,-99) ,
12, 6.6698, 0, 0, 0.504339,-99) ,
13, 1.22266, 0, 0, 0.512699,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525127,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50238,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.442124,-99) ,
13, 1.3748, 0, 0, 0.49905,-99) ,
11, 2.67765, 0, 0, 0.500951,-99) ,
6, -0.45969, 1, 0, 0.503688,-99) );
// itree = 608
fBoostWeights.push_back(0.0199823);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.86717, 0, 1, 0.511237,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519663,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49626,-99) ,
8, 2.38056, 0, 0, 0.499585,-99) ,
10, -0.142864, 1, 0, 0.503964,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518459,-99) ,
NN(
0,
0,
-1, -0.787368, 0, -1, 0.479777,-99) ,
11, -3.00576, 1, 0, 0.487309,-99) ,
12, 0.0998317, 0, 0, 0.501139,-99) );
// itree = 609
fBoostWeights.push_back(0.0101955);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.0136284, 0, 1, 0.526759,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512571,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499544,-99) ,
11, 3.79736, 0, 0, 0.502263,-99) ,
2, 0.21447, 0, 0, 0.503716,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472551,-99) ,
5, 0.996667, 0, 0, 0.502765,-99) );
// itree = 610
fBoostWeights.push_back(0.0186465);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 5.66251, 1, 1, 0.523957,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517891,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483441,-99) ,
10, 0.427848, 0, 0, 0.494959,-99) ,
13, 0.931315, 0, 0, 0.509155,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524557,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498459,-99) ,
11, 1.49899, 0, 0, 0.501584,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.448216,-99) ,
13, 1.25242, 0, 0, 0.499062,-99) ,
11, 3.80945, 0, 0, 0.501086,-99) );
// itree = 611
fBoostWeights.push_back(0.0138122);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 4.35103, 1, 1, 0.51509,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505143,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494769,-99) ,
0, 0.499995, 1, 0, 0.501919,-99) ,
2, -0.091905, 1, 0, 0.503618,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476416,-99) ,
2, -0.357189, 0, 0, 0.502895,-99) );
// itree = 612
fBoostWeights.push_back(0.013979);
fForest.push_back(
NN(
NN(
0,
0,
-1, -0.80988, 0, 1, 0.51882,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503775,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484711,-99) ,
8, 1.17616, 0, 0, 0.501529,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474444,-99) ,
7, 0.0237973, 1, 0, 0.500203,-99) ,
12, 9.88145, 0, 0, 0.501462,-99) );
// itree = 613
fBoostWeights.push_back(0.0175985);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527379,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514623,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492435,-99) ,
6, -0.699877, 1, 0, 0.502085,-99) ,
12, 4.58687, 1, 0, 0.507394,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.556346,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496918,-99) ,
11, 1.61578, 0, 0, 0.499289,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455665,-99) ,
12, 3.3508, 1, 0, 0.497342,-99) ,
11, 2.39501, 0, 0, 0.499917,-99) );
// itree = 614
fBoostWeights.push_back(0.0209066);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -2.31168, 1, 1, 0.507819,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472341,-99) ,
12, -0.966159, 0, 0, 0.505342,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538902,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497879,-99) ,
13, 0.945046, 0, 0, 0.509145,-99) ,
NN(
0,
0,
-1, 1.14385, 0, -1, 0.486358,-99) ,
11, 6.22162, 0, 0, 0.496438,-99) ,
3, 1.29673, 0, 0, 0.502427,-99) );
// itree = 615
fBoostWeights.push_back(0.0161281);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.05297, 0, 1, 0.518173,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505008,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476919,-99) ,
11, 4.38853, 0, 0, 0.495024,-99) ,
9, -40.0028, 1, 0, 0.509259,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531084,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498875,-99) ,
10, -1.57131, 1, 0, 0.501508,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454869,-99) ,
13, 1.316, 0, 0, 0.499651,-99) ,
11, 2.10924, 0, 0, 0.502282,-99) );
// itree = 616
fBoostWeights.push_back(0.0186947);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538248,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523007,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497143,-99) ,
12, 0.966726, 0, 0, 0.503194,-99) ,
6, 0.212903, 1, 0, 0.511255,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521513,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498991,-99) ,
12, 3.77011, 1, 0, 0.506628,-99) ,
NN(
0,
0,
-1, 1.50266, 0, -1, 0.492413,-99) ,
11, 0.958539, 0, 0, 0.499409,-99) ,
8, 2.18328, 0, 0, 0.502131,-99) );
// itree = 617
fBoostWeights.push_back(0.020321);
fForest.push_back(
NN(
NN(
0,
0,
-1, 1.25458, 0, 1, 0.524144,-99) ,
NN(
NN(
0,
0,
-1, 2.07672, 0, 1, 0.507014,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5048,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.452078,-99) ,
10, 0.233308, 1, 0, 0.494384,-99) ,
12, 0.923295, 0, 0, 0.503374,-99) ,
10, -1.57144, 1, 0, 0.505176,-99) );
// itree = 618
fBoostWeights.push_back(0.0206329);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.749807, 0, 1, 0.516347,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471561,-99) ,
10, 1.57143, 1, 0, 0.511167,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533525,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515787,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49471,-99) ,
10, -1.14973, 1, 0, 0.498464,-99) ,
10, 1.85705, 0, 0, 0.499743,-99) ,
8, 2.18328, 0, 0, 0.502347,-99) );
// itree = 619
fBoostWeights.push_back(0.0154343);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 7.51627, 0, 1, 0.531538,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522781,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487593,-99) ,
6, -0.816, 1, 0, 0.502144,-99) ,
13, 0.878926, 0, 0, 0.51592,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526974,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49928,-99) ,
11, 2.58582, 0, 0, 0.501321,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44499,-99) ,
8, 1.18062, 0, 0, 0.499233,-99) ,
11, 5.29659, 0, 0, 0.501967,-99) );
// itree = 620
fBoostWeights.push_back(0.0214533);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51955,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490853,-99) ,
13, 1.23316, 0, 0, 0.513236,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505434,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481722,-99) ,
12, 0.383394, 0, 0, 0.502496,-99) ,
10, -0.551077, 1, 0, 0.505978,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474541,-99) ,
10, 2.14279, 1, 0, 0.505184,-99) );
// itree = 621
fBoostWeights.push_back(0.00840438);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.56336, 0, 1, 0.526158,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517542,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499553,-99) ,
5, 0.999048, 1, 0, 0.501392,-99) ,
4, 0.539723, 1, 0, 0.502822,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483223,-99) ,
4, 8.96012, 1, 0, 0.501896,-99) );
// itree = 622
fBoostWeights.push_back(0.0183885);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518373,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485184,-99) ,
12, -0.830715, 0, 0, 0.512447,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511233,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497021,-99) ,
9, -948.705, 0, 0, 0.501794,-99) ,
3, 1.93411, 0, 0, 0.504448,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480768,-99) ,
0, 0.490471, 0, 0, 0.503419,-99) );
// itree = 623
fBoostWeights.push_back(0.014793);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.41165, 0, 1, 0.511585,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488451,-99) ,
3, 0.964967, 0, 0, 0.508312,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514702,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497405,-99) ,
12, 9.5582, 0, 0, 0.49901,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477204,-99) ,
12, 0.136328, 0, 0, 0.497467,-99) ,
10, -0.428628, 1, 0, 0.501344,-99) );
// itree = 624
fBoostWeights.push_back(0.0216023);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.50863, 1, 1, 0.512542,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508595,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494121,-99) ,
11, 2.99612, 0, 0, 0.500909,-99) ,
8, 1.70297, 0, 0, 0.505725,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518999,-99) ,
NN(
0,
0,
-1, -0.813494, 0, -1, 0.482474,-99) ,
11, -2.99331, 1, 0, 0.48971,-99) ,
12, 0.0998317, 0, 0, 0.503038,-99) );
// itree = 625
fBoostWeights.push_back(0.0248144);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510293,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46252,-99) ,
12, -1.26465, 0, 0, 0.508313,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478169,-99) ,
11, 14.2859, 1, 0, 0.506525,-99) ,
NN(
NN(
0,
0,
-1, 2.27374, 0, 1, 0.50494,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.431287,-99) ,
12, 1.29114, 0, 0, 0.495043,-99) ,
10, 0.714228, 1, 0, 0.503662,-99) );
// itree = 626
fBoostWeights.push_back(0.0236762);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.92048, 1, 1, 0.516129,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503216,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454426,-99) ,
13, 1.60726, 0, 0, 0.498516,-99) ,
11, 0.192971, 0, 0, 0.50422,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537374,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495697,-99) ,
3, 0.929038, 0, 0, 0.504718,-99) ,
NN(
0,
0,
-1, 1.20495, 0, -1, 0.474508,-99) ,
11, 5.64251, 0, 0, 0.493197,-99) ,
13, 1.30253, 0, 0, 0.501438,-99) );
// itree = 627
fBoostWeights.push_back(0.0221961);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529042,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51316,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490486,-99) ,
6, -0.601784, 1, 0, 0.50435,-99) ,
6, -0.356788, 0, 0, 0.508026,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.542158,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4939,-99) ,
11, -2.3578, 1, 0, 0.496944,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464362,-99) ,
12, -1.02377, 0, 0, 0.495044,-99) ,
11, 2.33638, 0, 0, 0.498418,-99) );
// itree = 628
fBoostWeights.push_back(0.021305);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.18231, 0, 1, 0.515939,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501918,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477848,-99) ,
11, 4.63716, 0, 0, 0.493758,-99) ,
9, -43.22, 1, 0, 0.507452,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505617,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483997,-99) ,
10, 1.00001, 1, 0, 0.50164,-99) ,
NN(
0,
0,
-1, 0.701819, 0, -1, 0.475003,-99) ,
8, 1.46194, 0, 0, 0.498198,-99) ,
11, 2.43801, 0, 0, 0.500546,-99) );
// itree = 629
fBoostWeights.push_back(0.0190791);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541876,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525236,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48655,-99) ,
3, 1.40809, 0, 0, 0.50238,-99) ,
9, -949.657, 0, 0, 0.512427,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518675,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495913,-99) ,
8, 2.32035, 0, 0, 0.499288,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474519,-99) ,
12, -0.473117, 0, 0, 0.497904,-99) ,
10, -1.28572, 1, 0, 0.499801,-99) );
// itree = 630
fBoostWeights.push_back(0.0201812);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.37575, 0, 1, 0.516004,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506494,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494414,-99) ,
10, 0.346903, 1, 0, 0.499824,-99) ,
10, -0.714309, 1, 0, 0.502915,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508667,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474823,-99) ,
12, -0.994822, 0, 0, 0.496887,-99) ,
NN(
0,
0,
-1, 2.32221, 0, -1, 0.471599,-99) ,
10, -0.570957, 1, 0, 0.488071,-99) ,
12, 0.23922, 0, 0, 0.500068,-99) );
// itree = 631
fBoostWeights.push_back(0.0137914);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527034,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510299,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499379,-99) ,
10, -0.428593, 1, 0, 0.50245,-99) ,
8, 2.71927, 0, 0, 0.503261,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513396,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486831,-99) ,
12, -0.31122, 0, 0, 0.498267,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.458686,-99) ,
0, 0.494283, 0, 0, 0.490802,-99) ,
12, 0.239737, 0, 0, 0.500868,-99) );
// itree = 632
fBoostWeights.push_back(0.0208585);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.38747, 1, 1, 0.509688,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507943,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493989,-99) ,
11, 6.62274, 0, 0, 0.498336,-99) ,
13, 1.64104, 0, 0, 0.503198,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520101,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486697,-99) ,
3, 2.22937, 0, 0, 0.497011,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460017,-99) ,
10, -0.0679296, 1, 0, 0.4907,-99) ,
12, 0.361928, 0, 0, 0.500522,-99) );
// itree = 633
fBoostWeights.push_back(0.0135687);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52816,-99) ,
NN(
NN(
0,
0,
-1, 1.87841, 0, 1, 0.504328,-99) ,
NN(
0,
0,
-1, 0.343759, 1, -1, 0.48972,-99) ,
12, 0.867254, 0, 0, 0.499963,-99) ,
10, -2.14287, 1, 0, 0.500829,-99) );
// itree = 634
fBoostWeights.push_back(0.00768014);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.078144, 0, 1, 0.526418,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516137,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499515,-99) ,
2, -0.193231, 1, 0, 0.500696,-99) ,
2, 0.214638, 0, 0, 0.502236,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47626,-99) ,
4, 9.78684, 1, 0, 0.501285,-99) );
// itree = 635
fBoostWeights.push_back(0.0265257);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.28552, 1, 1, 0.513594,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504301,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.43797,-99) ,
11, 5.242, 0, 0, 0.493136,-99) ,
8, 1.18649, 0, 0, 0.506565,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505046,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466563,-99) ,
10, 0.999365, 1, 0, 0.500358,-99) ,
NN(
0,
0,
-1, -1.38224, 1, -1, 0.459724,-99) ,
8, 1.71454, 0, 0, 0.49504,-99) ,
11, -0.167888, 0, 0, 0.50143,-99) );
// itree = 636
fBoostWeights.push_back(0.0186918);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.45173, 1, 1, 0.513188,-99) ,
NN(
0,
0,
-1, 1.57942, 0, -1, 0.495137,-99) ,
11, 0.736028, 0, 0, 0.500421,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507489,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480999,-99) ,
13, 0.743368, 0, 0, 0.497494,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.440889,-99) ,
12, 5.81765, 0, 0, 0.488049,-99) ,
8, 1.12143, 0, 0, 0.498385,-99) );
// itree = 637
fBoostWeights.push_back(0.0156817);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.45596, 0, 1, 0.525227,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492072,-99) ,
12, -0.802046, 0, 0, 0.516621,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.539049,-99) ,
NN(
0,
0,
-1, -0.0409507, 0, -1, 0.495449,-99) ,
3, 2.73085, 0, 0, 0.497135,-99) ,
10, -1.28571, 1, 0, 0.499701,-99) );
// itree = 638
fBoostWeights.push_back(0.0121773);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.43352, 0, 1, 0.504086,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500932,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454264,-99) ,
12, 6.406, 0, 0, 0.489365,-99) ,
8, 1.13172, 0, 0, 0.501732,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469675,-99) ,
1, 0.0244069, 1, 0, 0.500794,-99) );
// itree = 639
fBoostWeights.push_back(0.0214939);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.551606, 0, 1, 0.507684,-99) ,
NN(
0,
0,
-1, -0.693816, 1, -1, 0.481256,-99) ,
8, 1.12093, 0, 0, 0.503519,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510891,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490407,-99) ,
13, 2.02397, 0, 0, 0.495409,-99) ,
NN(
0,
0,
-1, -0.00121439, 1, -1, 0.476151,-99) ,
12, 0.414904, 0, 0, 0.493249,-99) ,
10, -0.428582, 1, 0, 0.496904,-99) );
// itree = 640
fBoostWeights.push_back(0.0150836);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 8.97397, 0, 1, 0.504996,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515384,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461905,-99) ,
6, 0.441304, 0, 0, 0.484729,-99) ,
5, 0.998572, 0, 0, 0.503535,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504448,-99) ,
NN(
0,
0,
-1, -0.0164343, 0, -1, 0.480721,-99) ,
10, -0.142897, 1, 0, 0.490554,-99) ,
9, 0.525285, 1, 0, 0.50181,-99) );
// itree = 641
fBoostWeights.push_back(0.0236357);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.686179, 1, 1, 0.508773,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503013,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481497,-99) ,
11, 5.2303, 0, 0, 0.494415,-99) ,
3, 1.22697, 0, 0, 0.501665,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.54514,-99) ,
NN(
0,
0,
-1, 0.725592, 1, -1, 0.487522,-99) ,
12, 1.51844, 0, 0, 0.492611,-99) ,
11, -0.180127, 0, 0, 0.497647,-99) );
// itree = 642
fBoostWeights.push_back(0.020581);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.56444,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498085,-99) ,
12, 1.24931, 0, 0, 0.50721,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509864,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491563,-99) ,
10, -1.1633, 1, 0, 0.495169,-99) ,
13, 1.93077, 0, 0, 0.49912,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500351,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510767,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445901,-99) ,
12, 2.2299, 0, 0, 0.474046,-99) ,
11, 1.01342, 0, 0, 0.487414,-99) ,
10, 1.28567, 1, 0, 0.497723,-99) );
// itree = 643
fBoostWeights.push_back(0.0230751);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.07151, 0, 1, 0.506186,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527796,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4659,-99) ,
11, -3.00046, 1, 0, 0.48574,-99) ,
12, -0.368908, 0, 0, 0.50335,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531621,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494066,-99) ,
8, 2.27306, 0, 0, 0.499816,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.432465,-99) ,
12, 1.20998, 0, 0, 0.491731,-99) ,
10, 0.71426, 1, 0, 0.500438,-99) );
// itree = 644
fBoostWeights.push_back(0.0183861);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509469,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485111,-99) ,
12, -0.634272, 0, 0, 0.506189,-99) ,
NN(
0,
0,
-1, 0.964412, 0, -1, 0.493467,-99) ,
13, 1.59541, 0, 0, 0.500565,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467203,-99) ,
10, 2.14276, 1, 0, 0.49972,-99) );
// itree = 645
fBoostWeights.push_back(0.0236544);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.558424,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494178,-99) ,
12, -0.251467, 0, 0, 0.519453,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522626,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494683,-99) ,
10, -1.80271, 1, 0, 0.497933,-99) ,
13, 1.98442, 0, 0, 0.503848,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523461,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495382,-99) ,
8, 2.31582, 0, 0, 0.499051,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455862,-99) ,
12, 0.705428, 0, 0, 0.494681,-99) ,
10, 0.142852, 1, 0, 0.499825,-99) );
// itree = 646
fBoostWeights.push_back(0.0203738);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516198,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477548,-99) ,
5, 0.999905, 0, 0, 0.507776,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528527,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496018,-99) ,
11, 1.90864, 0, 0, 0.498832,-99) ,
6, -0.369451, 1, 0, 0.501576,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.468778,-99) ,
5, 0.996191, 0, 0, 0.500717,-99) );
// itree = 647
fBoostWeights.push_back(0.0269143);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.8715, 1, 1, 0.520753,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503168,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471864,-99) ,
13, 1.57031, 0, 0, 0.498918,-99) ,
11, 0.982667, 0, 0, 0.503847,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52547,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516372,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459981,-99) ,
7, 0.00679992, 1, 0, 0.485663,-99) ,
7, 0.0238027, 0, 0, 0.492453,-99) ,
13, 1.1869, 0, 0, 0.501615,-99) );
// itree = 648
fBoostWeights.push_back(0.0130159);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.999658, 0, 1, 0.52233,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50392,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494032,-99) ,
11, -0.122439, 0, 0, 0.499582,-99) ,
2, 0.214085, 0, 0, 0.500877,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478152,-99) ,
5, 0.997619, 0, 0, 0.499896,-99) );
// itree = 649
fBoostWeights.push_back(0.0285914);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538144,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504464,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475102,-99) ,
10, 1.00026, 1, 0, 0.49766,-99) ,
6, 0.311406, 1, 0, 0.50842,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512415,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492065,-99) ,
8, 1.20753, 0, 0, 0.501735,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509182,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479519,-99) ,
9, -949.024, 0, 0, 0.488965,-99) ,
11, 0.958539, 0, 0, 0.494785,-99) ,
8, 2.36246, 0, 0, 0.497046,-99) );
// itree = 650
fBoostWeights.push_back(0.0199958);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.546049,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49842,-99) ,
12, 0.89576, 0, 0, 0.509198,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521719,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496271,-99) ,
10, -1.57141, 1, 0, 0.499135,-99) ,
8, 1.96257, 0, 0, 0.502318,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529419,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480011,-99) ,
10, 1.77545, 0, 0, 0.502327,-99) ,
NN(
0,
0,
-1, 1.69381, 1, -1, 0.467666,-99) ,
11, 0.804813, 0, 0, 0.486601,-99) ,
10, 1.28565, 1, 0, 0.500475,-99) );
// itree = 651
fBoostWeights.push_back(0.0216168);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.18451, 0, 1, 0.513398,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508833,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492635,-99) ,
11, 1.54314, 0, 0, 0.499682,-99) ,
13, 1.97905, 0, 0, 0.50381,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, -1, 0.495107,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503033,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.433821,-99) ,
10, 1.69386, 1, 0, 0.46894,-99) ,
11, 1.07732, 0, 0, 0.481948,-99) ,
10, 1.28569, 1, 0, 0.501225,-99) );
// itree = 652
fBoostWeights.push_back(0.018472);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523281,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496398,-99) ,
12, 0.747353, 0, 0, 0.508634,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500157,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47278,-99) ,
5, 0.999524, 0, 0, 0.497603,-99) ,
13, 1.62119, 0, 0, 0.503452,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505606,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503377,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.442792,-99) ,
12, 2.1955, 0, 0, 0.470243,-99) ,
11, 1.04642, 0, 0, 0.488077,-99) ,
10, 1.28564, 1, 0, 0.501641,-99) );
// itree = 653
fBoostWeights.push_back(0.0237777);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515297,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49565,-99) ,
10, 0.061314, 1, 0, 0.506798,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500055,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483207,-99) ,
11, 2.6771, 0, 0, 0.492566,-99) ,
13, 1.55369, 0, 0, 0.500777,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52235,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473431,-99) ,
10, 1.77547, 0, 0, 0.49569,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510536,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.435687,-99) ,
12, 2.10854, 0, 0, 0.470913,-99) ,
11, 0.852705, 0, 0, 0.48408,-99) ,
10, 1.28569, 1, 0, 0.498796,-99) );
// itree = 654
fBoostWeights.push_back(0.0255096);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517964,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495988,-99) ,
12, 0.618001, 0, 0, 0.506922,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505479,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445184,-99) ,
12, 1.84153, 0, 0, 0.48669,-99) ,
10, 1.00008, 1, 0, 0.502829,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504158,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.482182,-99) ,
5, 0.999977, 0, 0, 0.494432,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464085,-99) ,
5, 0.999524, 0, 0, 0.491799,-99) ,
8, 1.53506, 0, 0, 0.498515,-99) );
// itree = 655
fBoostWeights.push_back(0.0208596);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534016,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505902,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462797,-99) ,
12, 3.44771, 1, 0, 0.502839,-99) ,
11, 3.24368, 0, 0, 0.504485,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501431,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.482701,-99) ,
13, 0.801123, 0, 0, 0.49346,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455526,-99) ,
12, 5.33798, 0, 0, 0.486842,-99) ,
13, 1.16524, 0, 0, 0.501197,-99) );
// itree = 656
fBoostWeights.push_back(0.0214943);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.33671, 0, 1, 0.507914,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525048,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492621,-99) ,
10, -1.77551, 1, 0, 0.495265,-99) ,
8, 1.96259, 0, 0, 0.499252,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518762,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478219,-99) ,
10, 1.77547, 0, 0, 0.49696,-99) ,
NN(
0,
0,
-1, 1.69386, 1, -1, 0.463848,-99) ,
11, 0.730077, 0, 0, 0.482265,-99) ,
10, 1.28569, 1, 0, 0.49726,-99) );
// itree = 657
fBoostWeights.push_back(0.0256129);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.820154, 0, 1, 0.51331,-99) ,
NN(
0,
0,
-1, 4.1806, 0, -1, 0.48423,-99) ,
13, 1.24324, 0, 0, 0.506691,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52757,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528676,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490675,-99) ,
8, 2.86537, 0, 0, 0.493338,-99) ,
12, 10.6281, 0, 0, 0.49582,-99) ,
10, -0.14287, 1, 0, 0.500791,-99) );
// itree = 658
fBoostWeights.push_back(0.0233916);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.416289, 1, 1, 0.51174,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514688,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492673,-99) ,
7, 0.0238027, 0, 0, 0.495569,-99) ,
8, 1.43277, 0, 0, 0.502473,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535306,-99) ,
NN(
0,
0,
-1, 0.666456, 1, -1, 0.487967,-99) ,
12, 1.52318, 0, 0, 0.492172,-99) ,
11, -0.167888, 0, 0, 0.497892,-99) );
// itree = 659
fBoostWeights.push_back(0.0169801);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524403,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505001,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495273,-99) ,
10, 0.142852, 1, 0, 0.500341,-99) ,
8, 2.60426, 0, 0, 0.501715,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511308,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512915,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462539,-99) ,
10, -1.35166, 1, 0, 0.477918,-99) ,
11, -2.81623, 1, 0, 0.488689,-99) ,
12, -0.0983186, 0, 0, 0.499899,-99) );
// itree = 660
fBoostWeights.push_back(0.0179647);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.55983,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499946,-99) ,
10, 0.274076, 1, 0, 0.520397,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484847,-99) ,
12, -0.550039, 0, 0, 0.509681,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508245,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49593,-99) ,
3, 1.53825, 0, 0, 0.499437,-99) ,
NN(
0,
0,
-1, -0.224248, 1, -1, 0.487883,-99) ,
12, 0.958041, 0, 0, 0.49682,-99) ,
8, 2.31704, 0, 0, 0.499135,-99) );
// itree = 661
fBoostWeights.push_back(0.0219338);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.562672,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494475,-99) ,
10, 0.728128, 1, 0, 0.518762,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509205,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497629,-99) ,
11, 2.52313, 0, 0, 0.501523,-99) ,
8, 2.31608, 0, 0, 0.503314,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.554012,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476608,-99) ,
12, -0.785232, 0, 0, 0.505627,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50016,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45907,-99) ,
11, -1.75798, 0, 0, 0.473757,-99) ,
11, -2.29908, 1, 0, 0.490655,-99) ,
12, 0.0998317, 0, 0, 0.501156,-99) );
// itree = 662
fBoostWeights.push_back(0.0216174);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.24538, 1, 1, 0.519233,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503968,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469134,-99) ,
10, 1.28567, 1, 0, 0.501207,-99) ,
11, 0.272785, 0, 0, 0.506749,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516648,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496181,-99) ,
12, 10.6483, 0, 0, 0.501634,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.448877,-99) ,
11, 2.52548, 0, 0, 0.494937,-99) ,
8, 1.30769, 0, 0, 0.503789,-99) );
// itree = 663
fBoostWeights.push_back(0.0183682);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.464884, 0, 1, 0.514661,-99) ,
NN(
0,
0,
-1, 1.03267, 0, -1, 0.484351,-99) ,
13, 1.23358, 0, 0, 0.507922,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53987,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498682,-99) ,
12, 3.40866, 1, 0, 0.504721,-99) ,
NN(
0,
0,
-1, 1.61339, 0, -1, 0.492793,-99) ,
11, 1.29882, 0, 0, 0.497298,-99) ,
10, -0.714303, 1, 0, 0.500124,-99) );
// itree = 664
fBoostWeights.push_back(0.0153212);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537309,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504205,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476499,-99) ,
8, 1.09678, 0, 0, 0.501865,-99) ,
12, 9.12893, 0, 0, 0.503406,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480427,-99) ,
8, 0.705482, 0, 0, 0.502556,-99) );
// itree = 665
fBoostWeights.push_back(0.0174408);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536342,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495065,-99) ,
6, 0.509278, 1, 0, 0.514042,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504673,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489695,-99) ,
11, -0.102055, 0, 0, 0.498605,-99) ,
8, 2.60413, 0, 0, 0.500177,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472086,-99) ,
10, 2.14277, 1, 0, 0.499464,-99) );
// itree = 666
fBoostWeights.push_back(0.0168324);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518024,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512569,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491588,-99) ,
13, 1.46263, 0, 0, 0.503698,-99) ,
NN(
0,
0,
-1, 0.829984, 0, -1, 0.493835,-99) ,
10, -0.428593, 1, 0, 0.497372,-99) ,
3, 2.5715, 0, 0, 0.498556,-99) );
// itree = 667
fBoostWeights.push_back(0.019174);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 7.91588, 0, 1, 0.518082,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508373,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481636,-99) ,
12, 11.7855, 0, 0, 0.495895,-99) ,
13, 0.877138, 0, 0, 0.510644,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503324,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463278,-99) ,
10, 1.85712, 1, 0, 0.5015,-99) ,
NN(
0,
0,
-1, 0.912462, 0, -1, 0.472535,-99) ,
8, 1.42712, 0, 0, 0.498469,-99) ,
11, 2.38183, 0, 0, 0.501618,-99) );
// itree = 668
fBoostWeights.push_back(0.0188276);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527162,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50822,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498585,-99) ,
8, 1.83658, 0, 0, 0.501055,-99) ,
8, 2.50478, 0, 0, 0.502459,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.545895,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477917,-99) ,
11, -1.92291, 1, 0, 0.502924,-99) ,
NN(
0,
0,
-1, -1.25929, 0, -1, 0.475928,-99) ,
12, -0.37023, 0, 0, 0.489821,-99) ,
12, 0.361928, 0, 0, 0.499745,-99) );
// itree = 669
fBoostWeights.push_back(0.0218883);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.55068,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529527,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493825,-99) ,
10, 0.427707, 0, 0, 0.505914,-99) ,
8, 1.03732, 0, 0, 0.515259,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512391,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494534,-99) ,
11, 0.417755, 0, 0, 0.500266,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465418,-99) ,
8, 1.19325, 0, 0, 0.498778,-99) ,
11, 5.29659, 0, 0, 0.501471,-99) );
// itree = 670
fBoostWeights.push_back(0.0143609);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.532353,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484202,-99) ,
3, 0.994798, 0, 0, 0.522634,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500626,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478279,-99) ,
0, 0.498092, 0, 0, 0.489105,-99) ,
6, 0.0731776, 1, 0, 0.51356,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53262,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500099,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478429,-99) ,
12, 0.0566766, 0, 0, 0.498269,-99) ,
3, 2.73084, 0, 0, 0.499597,-99) ,
10, -1.00001, 1, 0, 0.502289,-99) );
// itree = 671
fBoostWeights.push_back(0.023296);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529176,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.554773,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.482145,-99) ,
7, 0.00453333, 1, 0, 0.504897,-99) ,
7, 0.0238015, 0, 0, 0.509169,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541634,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497413,-99) ,
11, 1.87933, 0, 0, 0.500494,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457851,-99) ,
12, 3.96164, 1, 0, 0.497891,-99) ,
11, 4.28081, 0, 0, 0.500004,-99) );
// itree = 672
fBoostWeights.push_back(0.0228835);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.36764, 0, 1, 0.511918,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506217,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487056,-99) ,
11, 1.31633, 0, 0, 0.498515,-99) ,
8, 1.75366, 0, 0, 0.504597,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51105,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461425,-99) ,
8, 1.90427, 1, 0, 0.484332,-99) ,
10, 1.57135, 1, 0, 0.503091,-99) );
// itree = 673
fBoostWeights.push_back(0.0251661);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.1211, 0, 1, 0.511518,-99) ,
NN(
0,
0,
-1, -1.16005, 0, -1, 0.481831,-99) ,
12, -0.248336, 0, 0, 0.505396,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523428,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493499,-99) ,
8, 2.27358, 0, 0, 0.497588,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461216,-99) ,
12, 0.775381, 0, 0, 0.4935,-99) ,
10, 0.142863, 1, 0, 0.500191,-99) );
// itree = 674
fBoostWeights.push_back(0.0219055);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537782,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522498,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483915,-99) ,
3, 1.40791, 0, 0, 0.499753,-99) ,
9, -949.657, 0, 0, 0.509634,-99) ,
NN(
NN(
0,
0,
-1, 0.302821, 1, 1, 0.510717,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508941,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491394,-99) ,
11, 4.90453, 0, 0, 0.495297,-99) ,
8, 2.36254, 0, 0, 0.497947,-99) ,
10, -1.28572, 1, 0, 0.49948,-99) );
// itree = 675
fBoostWeights.push_back(0.0154201);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505348,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46817,-99) ,
12, -1.00767, 0, 0, 0.503598,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478142,-99) ,
3, 0.659358, 0, 0, 0.502505,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474592,-99) ,
10, 2.1428, 1, 0, 0.501797,-99) );
// itree = 676
fBoostWeights.push_back(0.0225177);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.551687,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503378,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475224,-99) ,
8, 1.47476, 0, 0, 0.500318,-99) ,
11, 1.72126, 0, 0, 0.503078,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525068,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491161,-99) ,
8, 1.00888, 0, 0, 0.498893,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511065,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.449469,-99) ,
11, 3.37916, 0, 0, 0.481338,-99) ,
11, 5.62747, 0, 0, 0.491745,-99) ,
12, 3.53499, 1, 0, 0.500045,-99) );
// itree = 677
fBoostWeights.push_back(0.019367);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.810504, 1, 1, 0.527258,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487919,-99) ,
12, -0.611864, 0, 0, 0.513833,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505097,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490843,-99) ,
10, 1, 1, 0, 0.501906,-99) ,
NN(
0,
0,
-1, -0.0969985, 1, -1, 0.485035,-99) ,
12, 0.840957, 0, 0, 0.497861,-99) ,
8, 2.56929, 0, 0, 0.499613,-99) );
// itree = 678
fBoostWeights.push_back(0.0225896);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521532,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48401,-99) ,
12, -0.8611, 0, 0, 0.512088,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46372,-99) ,
8, 1.08735, 0, 0, 0.505536,-99) ,
NN(
NN(
0,
0,
-1, 1.15063, 0, 1, 0.508085,-99) ,
NN(
0,
0,
-1, 3.55704, 1, -1, 0.491155,-99) ,
11, 3.46941, 0, 0, 0.495067,-99) ,
10, -1, 1, 0, 0.497079,-99) );
// itree = 679
fBoostWeights.push_back(0.0218439);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521657,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494884,-99) ,
8, 1.2609, 0, 0, 0.514953,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507653,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492106,-99) ,
8, 1.97301, 0, 0, 0.497152,-99) ,
10, -1.16328, 1, 0, 0.500308,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503016,-99) ,
NN(
0,
0,
-1, 0.169084, 1, -1, 0.468379,-99) ,
9, -951.286, 0, 0, 0.48078,-99) ,
10, 1.28564, 1, 0, 0.498025,-99) );
// itree = 680
fBoostWeights.push_back(0.0253992);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519209,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496336,-99) ,
10, 0.613866, 1, 0, 0.509491,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513582,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490974,-99) ,
12, 9.05632, 0, 0, 0.496526,-99) ,
13, 1.42262, 0, 0, 0.504239,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507425,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478078,-99) ,
12, -0.919353, 0, 0, 0.49894,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459474,-99) ,
10, -0.0882432, 1, 0, 0.491999,-99) ,
12, 0.361928, 0, 0, 0.501623,-99) );
// itree = 681
fBoostWeights.push_back(0.0219343);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.51645, 1, 1, 0.515083,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501627,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46841,-99) ,
13, 1.6068, 0, 0, 0.497222,-99) ,
11, 0.603926, 0, 0, 0.502197,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.53274,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487675,-99) ,
13, 0.879569, 0, 0, 0.5024,-99) ,
NN(
0,
0,
-1, 4.10286, 0, -1, 0.474772,-99) ,
11, 7.21794, 0, 0, 0.491991,-99) ,
13, 1.21203, 0, 0, 0.500076,-99) );
// itree = 682
fBoostWeights.push_back(0.0188442);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526128,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506243,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494636,-99) ,
8, 1.7033, 0, 0, 0.499403,-99) ,
10, -1.57144, 1, 0, 0.500779,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525713,-99) ,
NN(
0,
0,
-1, -0.366609, 0, -1, 0.482052,-99) ,
11, -2.99624, 1, 0, 0.488956,-99) ,
12, 0.361928, 0, 0, 0.498256,-99) );
// itree = 683
fBoostWeights.push_back(0.0218816);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.557746,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498833,-99) ,
13, 1.4292, 0, 0, 0.516709,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5057,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493254,-99) ,
11, 1.00247, 0, 0, 0.498941,-99) ,
10, -1.00001, 1, 0, 0.501303,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528221,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481223,-99) ,
11, -2.50467, 1, 0, 0.494209,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455739,-99) ,
12, -1.22463, 0, 0, 0.487501,-99) ,
12, 0.138275, 0, 0, 0.498885,-99) );
// itree = 684
fBoostWeights.push_back(0.0213581);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.38342, 1, 1, 0.506819,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505171,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486934,-99) ,
12, 7.3595, 0, 0, 0.493349,-99) ,
13, 1.42262, 0, 0, 0.501317,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512061,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480226,-99) ,
12, -0.500029, 0, 0, 0.496986,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464828,-99) ,
10, -0.067917, 1, 0, 0.491255,-99) ,
12, 0.413866, 0, 0, 0.499072,-99) );
// itree = 685
fBoostWeights.push_back(0.0136488);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.0164048, 0, 1, 0.518549,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517178,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495385,-99) ,
2, 0.132389, 0, 0, 0.496485,-99) ,
2, 0.214006, 0, 0, 0.4978,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47488,-99) ,
4, 9.42256, 1, 0, 0.496861,-99) );
// itree = 686
fBoostWeights.push_back(0.0189502);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.04328, 0, 1, 0.513145,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48035,-99) ,
3, 0.96207, 0, 0, 0.508716,-99) ,
NN(
NN(
0,
0,
-1, 1.12409, 0, 1, 0.509409,-99) ,
NN(
0,
0,
-1, 1.38085, 0, -1, 0.492659,-99) ,
11, 3.62296, 0, 0, 0.496535,-99) ,
10, -0.714295, 1, 0, 0.499784,-99) );
// itree = 687
fBoostWeights.push_back(0.0149461);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51104,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496798,-99) ,
11, 0.662831, 0, 0, 0.502173,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484453,-99) ,
11, 13.5895, 1, 0, 0.500957,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.468622,-99) ,
2, 0.357034, 1, 0, 0.500077,-99) );
// itree = 688
fBoostWeights.push_back(0.0211413);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52368,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511021,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496161,-99) ,
8, 1.37395, 0, 0, 0.503131,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.540429,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489441,-99) ,
12, 1.5859, 0, 0, 0.4945,-99) ,
11, -0.0662606, 0, 0, 0.499314,-99) ,
3, 2.68748, 0, 0, 0.500328,-99) );
// itree = 689
fBoostWeights.push_back(0.0175053);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.151164, 0, 1, 0.532799,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515882,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480611,-99) ,
3, 2.47594, 0, 0, 0.501599,-99) ,
6, 0.435805, 1, 0, 0.515101,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51817,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497741,-99) ,
11, -0.828853, 0, 0, 0.509752,-99) ,
NN(
0,
0,
-1, 1.07011, 0, -1, 0.496243,-99) ,
10, -0.714298, 1, 0, 0.499987,-99) ,
8, 2.39368, 0, 0, 0.502343,-99) );
// itree = 690
fBoostWeights.push_back(0.0154997);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.47091, 0, 1, 0.505443,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52018,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483991,-99) ,
11, -2.97368, 1, 0, 0.492326,-99) ,
12, -0.00766644, 0, 0, 0.503465,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471268,-99) ,
2, -0.357266, 0, 0, 0.502617,-99) );
// itree = 691
fBoostWeights.push_back(0.0120655);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516079,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49334,-99) ,
8, 1.29415, 0, 0, 0.509884,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500472,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471838,-99) ,
12, -0.0875965, 0, 0, 0.498751,-99) ,
10, -0.714324, 1, 0, 0.501729,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474665,-99) ,
5, 0.997619, 0, 0, 0.500584,-99) );
// itree = 692
fBoostWeights.push_back(0.0184485);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.25981, 0, 1, 0.51203,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471934,-99) ,
10, 1.5715, 1, 0, 0.507488,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517784,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507813,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493813,-99) ,
2, -0.0712364, 1, 0, 0.496263,-99) ,
10, -1.85728, 1, 0, 0.49758,-99) ,
13, 2.00101, 0, 0, 0.500633,-99) );
// itree = 693
fBoostWeights.push_back(0.0138399);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524012,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493782,-99) ,
8, 1.29138, 0, 0, 0.514388,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503538,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490504,-99) ,
12, 0.995389, 0, 0, 0.499709,-99) ,
10, -1.57144, 1, 0, 0.500955,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476547,-99) ,
5, 0.996667, 0, 0, 0.500207,-99) );
// itree = 694
fBoostWeights.push_back(0.0163865);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530732,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506167,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48579,-99) ,
10, 1.53059, 1, 0, 0.503803,-99) ,
NN(
0,
0,
-1, 0.321018, 1, -1, 0.491581,-99) ,
12, 0.847023, 0, 0, 0.500245,-99) ,
10, -2.14286, 1, 0, 0.501174,-99) );
// itree = 695
fBoostWeights.push_back(0.0245284);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.0614406, 0, 1, 0.52264,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529318,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.451395,-99) ,
12, 1.07395, 0, 0, 0.493795,-99) ,
10, 0.428719, 1, 0, 0.510633,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522432,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495938,-99) ,
9, -1.26137, 0, 0, 0.502612,-99) ,
NN(
0,
0,
-1, 1.32442, 0, -1, 0.49362,-99) ,
10, -0.428667, 1, 0, 0.496983,-99) ,
8, 2.1833, 0, 0, 0.50012,-99) );
// itree = 696
fBoostWeights.push_back(0.0161503);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -2.14287, 1, 1, 0.514599,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.482981,-99) ,
5, 0.999524, 0, 0, 0.510028,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.532506,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499071,-99) ,
3, 1.88296, 0, 0, 0.502613,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500805,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.437189,-99) ,
10, 0.645048, 1, 0, 0.490851,-99) ,
12, 1.37465, 0, 0, 0.498518,-99) ,
10, -1.00003, 1, 0, 0.500725,-99) );
// itree = 697
fBoostWeights.push_back(0.0118662);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.0116322, 0, 1, 0.531878,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516415,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497554,-99) ,
5, 0.999048, 1, 0, 0.499152,-99) ,
2, 0.214849, 0, 0, 0.501126,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480105,-99) ,
4, 9.43575, 1, 0, 0.50026,-99) );
// itree = 698
fBoostWeights.push_back(0.0221922);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524715,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47654,-99) ,
12, -1.21553, 0, 0, 0.517199,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508664,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.453086,-99) ,
11, 0.347188, 0, 0, 0.49722,-99) ,
8, 1.51019, 0, 0, 0.508487,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534734,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499077,-99) ,
12, 0.278742, 0, 0, 0.516382,-99) ,
NN(
0,
0,
-1, 0.781873, 0, -1, 0.495896,-99) ,
8, 2.60406, 0, 0, 0.498201,-99) ,
10, -0.428544, 1, 0, 0.501864,-99) );
// itree = 699
fBoostWeights.push_back(0.0254633);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.27551, 0, 1, 0.506225,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478229,-99) ,
5, 0.998095, 0, 0, 0.505156,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.567099,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474495,-99) ,
12, -0.553423, 0, 0, 0.503621,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52333,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466778,-99) ,
11, -1.48894, 0, 0, 0.484604,-99) ,
11, -2.14221, 1, 0, 0.494309,-99) ,
12, 0.361928, 0, 0, 0.502834,-99) );
// itree = 700
fBoostWeights.push_back(0.0162967);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.00001, 1, 1, 0.504865,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.553389,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49191,-99) ,
12, 1.36335, 0, 0, 0.497126,-99) ,
11, -0.395026, 0, 0, 0.501769,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47553,-99) ,
2, 0.357041, 1, 0, 0.501057,-99) );
// itree = 701
fBoostWeights.push_back(0.028552);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.647517, 0, 1, 0.509937,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509276,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.456336,-99) ,
12, 2.04046, 0, 0, 0.488478,-99) ,
10, 1.00005, 1, 0, 0.505564,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513867,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484807,-99) ,
9, -951.227, 1, 0, 0.502718,-99) ,
NN(
0,
0,
-1, 2.27862, 1, -1, 0.477297,-99) ,
11, 1.80318, 0, 0, 0.49524,-99) ,
8, 1.55213, 0, 0, 0.501414,-99) );
// itree = 702
fBoostWeights.push_back(0.015248);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.541718,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.561073,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470833,-99) ,
4, 4.99839, 1, 0, 0.516901,-99) ,
NN(
0,
0,
-1, 0.673545, 0, -1, 0.496148,-99) ,
2, -0.214262, 1, 0, 0.49749,-99) ,
10, -2.14287, 1, 0, 0.49885,-99) );
// itree = 703
fBoostWeights.push_back(0.0155021);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519823,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49917,-99) ,
12, 0.0238724, 0, 0, 0.511403,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505108,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492325,-99) ,
12, 1.58608, 0, 0, 0.49991,-99) ,
10, -1.04085, 1, 0, 0.502044,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472958,-99) ,
10, 2.1428, 1, 0, 0.501312,-99) );
// itree = 704
fBoostWeights.push_back(0.013435);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.59551, 0, 1, 0.511357,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5213,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496836,-99) ,
10, -1.77551, 1, 0, 0.498578,-99) ,
13, 2.05156, 0, 0, 0.502121,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479987,-99) ,
10, 2.14277, 1, 0, 0.501556,-99) );
// itree = 705
fBoostWeights.push_back(0.0121277);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52923,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494378,-99) ,
9, -12.1436, 1, 0, 0.513411,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527107,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498237,-99) ,
10, -2.0204, 1, 0, 0.499494,-99) ,
3, 2.09346, 0, 0, 0.501925,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476079,-99) ,
10, 2.14283, 1, 0, 0.501271,-99) );
// itree = 706
fBoostWeights.push_back(0.0234994);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.32163, 0, 1, 0.511694,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507915,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49082,-99) ,
11, 1.57803, 0, 0, 0.498389,-99) ,
8, 1.96268, 0, 0, 0.502594,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529696,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485134,-99) ,
10, 1.77547, 0, 0, 0.505814,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505276,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.433809,-99) ,
10, 1.69386, 1, 0, 0.470175,-99) ,
11, 0.854458, 0, 0, 0.489264,-99) ,
10, 1.28569, 1, 0, 0.501032,-99) );
// itree = 707
fBoostWeights.push_back(0.0259505);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.1774, 0, 1, 0.509086,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507629,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.456399,-99) ,
12, 1.46419, 0, 0, 0.497039,-99) ,
10, 0.428533, 1, 0, 0.504349,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512969,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475686,-99) ,
12, -1.11833, 0, 0, 0.499451,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460983,-99) ,
10, -0.554045, 1, 0, 0.489637,-99) ,
12, -0.118879, 0, 0, 0.502339,-99) );
// itree = 708
fBoostWeights.push_back(0.0106353);
fForest.push_back(
NN(
NN(
0,
0,
-1, 2.76421, 0, 1, 0.521567,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500727,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487308,-99) ,
8, 1.18319, 0, 0, 0.497882,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469632,-99) ,
5, 0.997619, 0, 0, 0.496892,-99) ,
3, 2.52665, 0, 0, 0.498462,-99) );
// itree = 709
fBoostWeights.push_back(0.0213518);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.521902,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.468728,-99) ,
12, -1.18508, 0, 0, 0.512529,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472969,-99) ,
8, 1.09371, 0, 0, 0.506946,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516428,-99) ,
NN(
0,
0,
-1, 1.47618, 1, -1, 0.493182,-99) ,
8, 2.81444, 0, 0, 0.494839,-99) ,
10, -0.99999, 1, 0, 0.49716,-99) );
// itree = 710
fBoostWeights.push_back(0.0130845);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523235,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526697,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497028,-99) ,
8, 1.09678, 0, 0, 0.507001,-99) ,
NN(
0,
0,
-1, 3.53163, 1, -1, 0.49548,-99) ,
11, 3.02655, 0, 0, 0.498173,-99) ,
10, -2.14279, 1, 0, 0.49893,-99) );
// itree = 711
fBoostWeights.push_back(0.0180821);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.577981,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489681,-99) ,
9, -949.113, 0, 0, 0.523504,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503546,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491357,-99) ,
9, -949.159, 1, 0, 0.499194,-99) ,
5, 0.999048, 1, 0, 0.501721,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478735,-99) ,
4, 9.78684, 1, 0, 0.500879,-99) );
// itree = 712
fBoostWeights.push_back(0.0233734);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.569022,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498765,-99) ,
12, 2.66505, 1, 0, 0.51674,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504605,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476721,-99) ,
8, 1.68237, 0, 0, 0.499636,-99) ,
11, 0.684962, 0, 0, 0.503291,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509961,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48307,-99) ,
11, 13.6043, 1, 0, 0.497738,-99) ,
NN(
0,
0,
-1, 3.50758, 0, -1, 0.481314,-99) ,
6, -0.588446, 1, 0, 0.490292,-99) ,
8, 1.34175, 0, 0, 0.499762,-99) );
// itree = 713
fBoostWeights.push_back(0.0109832);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.999047, 1, 1, 0.510665,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50183,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494504,-99) ,
0, 0.497138, 1, 0, 0.497484,-99) ,
2, 0.0916735, 0, 0, 0.499205,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472426,-99) ,
2, 0.356936, 1, 0, 0.498477,-99) );
// itree = 714
fBoostWeights.push_back(0.0149633);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.999524, 1, 1, 0.50533,-99) ,
NN(
0,
0,
-1, -0.214184, 0, -1, 0.493988,-99) ,
4, 4.55231, 1, 0, 0.502982,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510481,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489727,-99) ,
12, -0.287637, 0, 0, 0.498695,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462264,-99) ,
10, 0.0564035, 1, 0, 0.49345,-99) ,
12, 0.442899, 0, 0, 0.500813,-99) );
// itree = 715
fBoostWeights.push_back(0.0135734);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528198,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508937,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498889,-99) ,
11, 3.16269, 0, 0, 0.501794,-99) ,
13, 2.67375, 0, 0, 0.502744,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52044,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501555,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460066,-99) ,
11, -2.17049, 1, 0, 0.485747,-99) ,
11, -1.56779, 0, 0, 0.491298,-99) ,
12, 0.281695, 0, 0, 0.500455,-99) );
// itree = 716
fBoostWeights.push_back(0.0196228);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.59492, 1, 1, 0.506474,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504734,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457938,-99) ,
11, 3.68454, 0, 0, 0.494923,-99) ,
8, 1.30714, 0, 0, 0.503129,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52085,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486729,-99) ,
12, -1.11836, 0, 0, 0.504805,-99) ,
NN(
0,
0,
-1, 2.25243, 0, -1, 0.47817,-99) ,
10, -1.14211, 1, 0, 0.490445,-99) ,
12, -0.118879, 0, 0, 0.501393,-99) );
// itree = 717
fBoostWeights.push_back(0.0142803);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51831,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498351,-99) ,
8, 2.18328, 0, 0, 0.501352,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47071,-99) ,
10, 2.14283, 1, 0, 0.500458,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512281,-99) ,
NN(
0,
0,
-1, -1.15829, 1, -1, 0.474189,-99) ,
11, -2.83336, 1, 0, 0.486412,-99) ,
12, -0.118879, 0, 0, 0.498549,-99) );
// itree = 718
fBoostWeights.push_back(0.0182868);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0.498091, 1, 1, 0.519245,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512586,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499061,-99) ,
13, 1.49897, 0, 0, 0.505474,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503013,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.448248,-99) ,
10, 0.384555, 1, 0, 0.493348,-99) ,
12, 1.15298, 0, 0, 0.501406,-99) ,
10, -1.57143, 1, 0, 0.502943,-99) );
// itree = 719
fBoostWeights.push_back(0.0179465);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.46429, 0, 1, 0.506576,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501087,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.437516,-99) ,
11, 2.52548, 0, 0, 0.494203,-99) ,
8, 1.2868, 0, 0, 0.502039,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504774,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480496,-99) ,
10, 0.714623, 1, 0, 0.497262,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461512,-99) ,
3, 1.63309, 0, 0, 0.493118,-99) ,
6, 0.0808558, 1, 0, 0.49896,-99) );
// itree = 720
fBoostWeights.push_back(0.0159487);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.544167,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49758,-99) ,
11, 3.31183, 0, 0, 0.500099,-99) ,
NN(
0,
0,
-1, 5.75776, 0, -1, 0.486228,-99) ,
13, 1.11852, 0, 0, 0.497714,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504583,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502389,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.438271,-99) ,
12, 2.28549, 0, 0, 0.465313,-99) ,
11, 1.12574, 0, 0, 0.484561,-99) ,
10, 1.28564, 1, 0, 0.496167,-99) );
// itree = 721
fBoostWeights.push_back(0.021222);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.532889,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498178,-99) ,
7, 0.011333, 0, 0, 0.502188,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537985,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459176,-99) ,
7, 0.00566684, 1, 0, 0.487303,-99) ,
3, 0.968747, 0, 0, 0.500315,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504011,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.451716,-99) ,
3, 1.08258, 1, 0, 0.480552,-99) ,
7, 0.0238014, 1, 0, 0.499096,-99) );
// itree = 722
fBoostWeights.push_back(0.0206252);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.54508,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488249,-99) ,
8, 0.74567, 0, 0, 0.512584,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519603,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496111,-99) ,
11, 0.893024, 0, 0, 0.502076,-99) ,
NN(
0,
0,
-1, 6.25118, 0, -1, 0.482272,-99) ,
8, 1.16018, 0, 0, 0.499927,-99) ,
12, 8.96386, 0, 0, 0.500938,-99) );
// itree = 723
fBoostWeights.push_back(0.00886218);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522459,-99) ,
NN(
NN(
0,
0,
-1, 2.67027, 0, 1, 0.502986,-99) ,
NN(
0,
0,
-1, 4.77828, 0, -1, 0.493698,-99) ,
8, 1.2481, 0, 0, 0.500859,-99) ,
3, 2.73084, 0, 0, 0.50165,-99) );
// itree = 724
fBoostWeights.push_back(0.0138158);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 8.76477, 0, 1, 0.503074,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472763,-99) ,
3, 0.655898, 0, 0, 0.501811,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535414,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485871,-99) ,
10, 1.77549, 0, 0, 0.508754,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501589,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.434836,-99) ,
10, 1.69389, 1, 0, 0.468931,-99) ,
11, 0.890789, 0, 0, 0.489982,-99) ,
10, 1.28569, 1, 0, 0.500418,-99) );
// itree = 725
fBoostWeights.push_back(0.0065712);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525801,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537104,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499717,-99) ,
12, 7.73538, 0, 0, 0.501043,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474534,-99) ,
11, 13.0905, 1, 0, 0.500077,-99) ,
12, 13.1966, 0, 0, 0.500987,-99) );
// itree = 726
fBoostWeights.push_back(0.0216649);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516919,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497896,-99) ,
8, 1.44092, 0, 0, 0.5064,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.540879,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49103,-99) ,
12, 1.22682, 0, 0, 0.497046,-99) ,
11, -0.395026, 0, 0, 0.502571,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472625,-99) ,
10, 2.1428, 1, 0, 0.501816,-99) );
// itree = 727
fBoostWeights.push_back(0.0291977);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519966,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493488,-99) ,
12, -0.444443, 0, 0, 0.512826,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508831,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487728,-99) ,
11, 1.7815, 0, 0, 0.4989,-99) ,
13, 1.62119, 0, 0, 0.505989,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510047,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486165,-99) ,
10, 1.40816, 1, 0, 0.502254,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.450302,-99) ,
12, 1.13608, 0, 0, 0.494762,-99) ,
10, 0.42856, 1, 0, 0.502173,-99) );
// itree = 728
fBoostWeights.push_back(0.0209046);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.717108, 0, 1, 0.511668,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50613,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462942,-99) ,
12, 7.7144, 0, 0, 0.483093,-99) ,
8, 1.10819, 0, 0, 0.507234,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528396,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500788,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459256,-99) ,
12, 1.02032, 0, 0, 0.495225,-99) ,
8, 2.7582, 0, 0, 0.497996,-99) ,
10, -0.142893, 1, 0, 0.502213,-99) );
// itree = 729
fBoostWeights.push_back(0.0189669);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.809909, 1, 1, 0.527826,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486168,-99) ,
12, -0.675823, 0, 0, 0.514282,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515756,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479794,-99) ,
8, 1.20148, 0, 0, 0.50792,-99) ,
NN(
0,
0,
-1, 0.673424, 0, -1, 0.495417,-99) ,
10, -0.714309, 1, 0, 0.49883,-99) ,
8, 2.60405, 0, 0, 0.500422,-99) );
// itree = 730
fBoostWeights.push_back(0.0208957);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.349478, 0, 1, 0.513049,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504281,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475702,-99) ,
11, 1.70095, 0, 0, 0.494891,-99) ,
3, 1.27538, 0, 0, 0.506751,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524592,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497209,-99) ,
8, 2.30013, 0, 0, 0.500217,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50566,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.443593,-99) ,
11, -1.80869, 1, 0, 0.473275,-99) ,
12, 0.743976, 0, 0, 0.496513,-99) ,
10, -0.142901, 1, 0, 0.501198,-99) );
// itree = 731
fBoostWeights.push_back(0.0159116);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.562095,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491141,-99) ,
3, 1.23298, 0, 0, 0.52333,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495091,-99) ,
12, -0.733109, 0, 0, 0.514677,-99) ,
NN(
NN(
0,
0,
-1, -2.27065, 1, 1, 0.514128,-99) ,
NN(
0,
0,
-1, -0.307984, 0, -1, 0.494373,-99) ,
3, 2.39455, 0, 0, 0.496209,-99) ,
10, -1.57144, 1, 0, 0.497788,-99) );
// itree = 732
fBoostWeights.push_back(0.011558);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533128,-99) ,
NN(
NN(
0,
0,
-1, 0.499043, 0, 1, 0.510715,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501865,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490629,-99) ,
12, 0.546444, 0, 0, 0.499221,-99) ,
2, -0.0714607, 1, 0, 0.501297,-99) ,
10, -2.14286, 1, 0, 0.502276,-99) );
// itree = 733
fBoostWeights.push_back(0.0234174);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527285,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531274,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493205,-99) ,
5, 0.999954, 0, 0, 0.503665,-99) ,
5, 0.999048, 1, 0, 0.509405,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511241,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461006,-99) ,
10, 1.57144, 1, 0, 0.505543,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503751,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484114,-99) ,
11, 0.784646, 0, 0, 0.49536,-99) ,
13, 2.0152, 0, 0, 0.498371,-99) ,
2, 0.0712553, 0, 0, 0.500394,-99) );
// itree = 734
fBoostWeights.push_back(0.0211421);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.552259,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498273,-99) ,
12, -0.727615, 0, 0, 0.528635,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484055,-99) ,
8, 1.29098, 0, 0, 0.51519,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525037,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480577,-99) ,
6, -0.0102148, 0, 0, 0.511814,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534889,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495065,-99) ,
4, 9.10586, 0, 0, 0.496961,-99) ,
5, 0.999524, 1, 0, 0.49939,-99) ,
10, -1.57144, 1, 0, 0.500739,-99) );
// itree = 735
fBoostWeights.push_back(0.0169849);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520639,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507197,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496275,-99) ,
8, 1.39681, 0, 0, 0.502987,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538323,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486256,-99) ,
11, -1.37628, 0, 0, 0.493258,-99) ,
12, 0.361928, 0, 0, 0.501103,-99) ,
3, 2.73085, 0, 0, 0.501825,-99) );
// itree = 736
fBoostWeights.push_back(0.014071);
fForest.push_back(
NN(
NN(
0,
0,
-1, -0.285033, 1, 1, 0.520053,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5237,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498266,-99) ,
13, 0.965255, 0, 0, 0.511303,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501324,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.452901,-99) ,
12, 3.46554, 1, 0, 0.498255,-99) ,
11, 2.9772, 0, 0, 0.501339,-99) ,
10, -1.85715, 1, 0, 0.502342,-99) );
// itree = 737
fBoostWeights.push_back(0.0167283);
fForest.push_back(
NN(
NN(
0,
0,
-1, -0.284301, 0, 1, 0.518925,-99) ,
NN(
NN(
0,
0,
-1, 2.45729, 1, 1, 0.506881,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502401,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462057,-99) ,
13, 1.69336, 0, 0, 0.49629,-99) ,
11, 0.570916, 0, 0, 0.501014,-99) ,
10, -1.57144, 1, 0, 0.502538,-99) );
// itree = 738
fBoostWeights.push_back(0.0142194);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.437388, 0, 1, 0.511802,-99) ,
NN(
0,
0,
-1, -0.422475, 0, -1, 0.497779,-99) ,
10, -1.09524, 1, 0, 0.500651,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509742,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48747,-99) ,
9, -951.286, 0, 0, 0.495233,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.431042,-99) ,
12, 1.59139, 0, 0, 0.484814,-99) ,
10, 0.999984, 1, 0, 0.497875,-99) );
// itree = 739
fBoostWeights.push_back(0.0175244);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 6.65151, 0, 1, 0.504254,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467372,-99) ,
13, 0.74553, 0, 0, 0.502305,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524709,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493324,-99) ,
6, -0.640292, 1, 0, 0.497552,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.443655,-99) ,
12, 0.987319, 0, 0, 0.491275,-99) ,
10, 0.428533, 1, 0, 0.498558,-99) );
// itree = 740
fBoostWeights.push_back(0.0107637);
fForest.push_back(
NN(
NN(
0,
0,
-1, 2.49986, 0, 1, 0.502172,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512455,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483065,-99) ,
12, -0.311233, 0, 0, 0.494486,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465726,-99) ,
3, 1.70247, 0, 0, 0.488992,-99) ,
12, 0.239737, 0, 0, 0.499634,-99) );
// itree = 741
fBoostWeights.push_back(0.0143029);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.546032,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49527,-99) ,
9, -951.223, 0, 0, 0.514697,-99) ,
NN(
0,
0,
-1, 0.999637, 0, -1, 0.496207,-99) ,
5, 0.999524, 1, 0, 0.499196,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47737,-99) ,
4, 9.42577, 1, 0, 0.498315,-99) );
// itree = 742
fBoostWeights.push_back(0.0184396);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525331,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537945,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499323,-99) ,
12, 1.43041, 1, 0, 0.502487,-99) ,
12, 13.1641, 0, 0, 0.503863,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.562444,-99) ,
NN(
0,
0,
-1, 0.679655, 1, -1, 0.488553,-99) ,
12, 1.40473, 0, 0, 0.494218,-99) ,
11, -0.395026, 0, 0, 0.499952,-99) );
// itree = 743
fBoostWeights.push_back(0.0137117);
fForest.push_back(
NN(
NN(
0,
0,
-1, 1.28299, 0, 1, 0.510203,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502281,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461013,-99) ,
12, 3.35106, 1, 0, 0.500414,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.447258,-99) ,
13, 1.28955, 0, 0, 0.498513,-99) ,
11, 2.38183, 0, 0, 0.501541,-99) );
// itree = 744
fBoostWeights.push_back(0.0138878);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.498091, 1, 1, 0.519333,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508894,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498234,-99) ,
11, 3.22623, 0, 0, 0.501392,-99) ,
13, 2.44821, 0, 0, 0.502561,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504997,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471877,-99) ,
8, 1.87715, 0, 0, 0.497832,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460215,-99) ,
10, -0.134753, 1, 0, 0.4912,-99) ,
12, 0.273961, 0, 0, 0.500305,-99) );
// itree = 745
fBoostWeights.push_back(0.0215422);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 3.47981, 0, 1, 0.509712,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511919,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488236,-99) ,
12, 7.87595, 0, 0, 0.499801,-99) ,
3, 1.09583, 0, 0, 0.505966,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503411,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467515,-99) ,
8, 1.70369, 0, 0, 0.498077,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461386,-99) ,
10, 0.999957, 1, 0, 0.494104,-99) ,
11, -0.122439, 0, 0, 0.500586,-99) );
// itree = 746
fBoostWeights.push_back(0.0223861);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504885,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473795,-99) ,
5, 0.99932, 0, 0, 0.503388,-99) ,
NN(
0,
0,
-1, 1.85499, 0, -1, 0.489267,-99) ,
6, 0.260991, 1, 0, 0.500639,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.560897,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.429364,-99) ,
9, -951.286, 0, 0, 0.482005,-99) ,
5, 0.998572, 0, 0, 0.499288,-99) );
// itree = 747
fBoostWeights.push_back(0.0155139);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538962,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499423,-99) ,
4, 4.52427, 1, 0, 0.519219,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520777,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494844,-99) ,
2, 0.193935, 0, 0, 0.49674,-99) ,
2, -0.214147, 1, 0, 0.498043,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.474321,-99) ,
4, 9.80004, 1, 0, 0.497181,-99) );
// itree = 748
fBoostWeights.push_back(0.0180318);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537177,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510232,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493475,-99) ,
12, 8.65616, 0, 0, 0.500565,-99) ,
12, 4.59924, 1, 0, 0.507334,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.536006,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496628,-99) ,
11, 1.34754, 0, 0, 0.499782,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454863,-99) ,
12, 3.47615, 1, 0, 0.497999,-99) ,
11, 2.55463, 0, 0, 0.500322,-99) );
// itree = 749
fBoostWeights.push_back(0.0161316);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528637,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530594,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493529,-99) ,
12, -0.322621, 0, 0, 0.514762,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503519,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490299,-99) ,
12, 1.54333, 0, 0, 0.498648,-99) ,
8, 2.56927, 0, 0, 0.500454,-99) ,
10, -2.14282, 1, 0, 0.501309,-99) );
// itree = 750
fBoostWeights.push_back(0.0193051);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.63064, 1, 1, 0.521286,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524376,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.4959,-99) ,
3, 2.77065, 0, 0, 0.497872,-99) ,
6, -0.161299, 1, 0, 0.501275,-99) ,
NN(
NN(
0,
0,
-1, 1.28164, 0, 1, 0.50554,-99) ,
NN(
0,
0,
-1, 0.365336, 0, -1, 0.479003,-99) ,
11, 2.47889, 0, 0, 0.494354,-99) ,
13, 1.59541, 0, 0, 0.498263,-99) );
// itree = 751
fBoostWeights.push_back(0.0164848);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.96868, 0, 1, 0.504871,-99) ,
NN(
0,
0,
-1, 5.92354, 0, -1, 0.486267,-99) ,
8, 1.12093, 0, 0, 0.501729,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515869,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49649,-99) ,
13, 2.10591, 0, 0, 0.500759,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.439425,-99) ,
12, 1.31906, 0, 0, 0.492186,-99) ,
10, 0.714268, 1, 0, 0.499331,-99) );
// itree = 752
fBoostWeights.push_back(0.0155929);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504986,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47212,-99) ,
10, 1.85715, 1, 0, 0.503232,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506547,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490479,-99) ,
10, 0.714082, 0, 0, 0.493766,-99) ,
8, 1.55237, 0, 0, 0.499418,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473087,-99) ,
0, 0.489519, 0, 0, 0.498749,-99) );
// itree = 753
fBoostWeights.push_back(0.0193025);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516587,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499215,-99) ,
11, 0.518523, 0, 0, 0.503492,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504114,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.470917,-99) ,
10, -0.137076, 1, 0, 0.484833,-99) ,
9, 0.525285, 1, 0, 0.501016,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534117,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488406,-99) ,
8, 1.01538, 0, 0, 0.498202,-99) ,
NN(
0,
0,
-1, 1.16523, 0, -1, 0.479383,-99) ,
11, 5.64251, 0, 0, 0.490465,-99) ,
8, 1.33584, 0, 0, 0.498179,-99) );
// itree = 754
fBoostWeights.push_back(0.0247234);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51873,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498621,-99) ,
12, 0.626722, 0, 0, 0.507957,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513732,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45367,-99) ,
12, 2.0434, 0, 0, 0.489762,-99) ,
10, 1.00006, 1, 0, 0.504156,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523985,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494401,-99) ,
6, -0.414017, 0, 0, 0.499994,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500223,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462997,-99) ,
11, 0.629578, 0, 0, 0.485546,-99) ,
11, 2.47889, 0, 0, 0.493881,-99) ,
13, 1.59541, 0, 0, 0.499674,-99) );
// itree = 755
fBoostWeights.push_back(0.0153452);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538637,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527308,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495544,-99) ,
3, 2.76934, 0, 0, 0.50423,-99) ,
6, 0.315214, 1, 0, 0.512987,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530006,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492189,-99) ,
13, 1.31108, 0, 0, 0.517032,-99) ,
NN(
0,
0,
-1, 0.276951, 0, -1, 0.496837,-99) ,
10, -1.28574, 1, 0, 0.499613,-99) ,
8, 2.39366, 0, 0, 0.50169,-99) );
// itree = 756
fBoostWeights.push_back(0.0227986);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.543856,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493043,-99) ,
12, -0.647016, 0, 0, 0.520226,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522864,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494196,-99) ,
9, -951.255, 0, 0, 0.502476,-99) ,
3, 1.75557, 0, 0, 0.507717,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527165,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499273,-99) ,
8, 2.31582, 0, 0, 0.502333,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514816,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.442224,-99) ,
11, -1.85504, 1, 0, 0.476458,-99) ,
12, 0.688856, 0, 0, 0.498994,-99) ,
10, -0.142893, 1, 0, 0.502973,-99) );
// itree = 757
fBoostWeights.push_back(0.0218073);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.999932, 0, 1, 0.525833,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505475,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494513,-99) ,
12, 1.29289, 0, 0, 0.501687,-99) ,
10, -1.57138, 1, 0, 0.503778,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.554086,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.438832,-99) ,
9, -951.286, 0, 0, 0.484121,-99) ,
5, 0.998571, 0, 0, 0.502372,-99) );
// itree = 758
fBoostWeights.push_back(0.0177183);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.452573, 0, 1, 0.516528,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503948,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486031,-99) ,
3, 0.907351, 0, 0, 0.494415,-99) ,
13, 1.21812, 0, 0, 0.511752,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524311,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484215,-99) ,
12, -0.192685, 0, 0, 0.513434,-99) ,
NN(
0,
0,
-1, 0.815089, 0, -1, 0.496816,-99) ,
8, 2.34795, 0, 0, 0.499863,-99) ,
10, -0.714324, 1, 0, 0.503038,-99) );
// itree = 759
fBoostWeights.push_back(0.0179554);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537827,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515767,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495095,-99) ,
6, -0.711861, 1, 0, 0.505041,-99) ,
12, 5.44528, 1, 0, 0.511062,-99) ,
NN(
NN(
0,
0,
-1, 1.78326, 0, 1, 0.504631,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501093,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461035,-99) ,
12, 2.02064, 1, 0, 0.473382,-99) ,
8, 1.39361, 0, 0, 0.500868,-99) ,
11, 3.63558, 0, 0, 0.502965,-99) );
// itree = 760
fBoostWeights.push_back(0.0168188);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530053,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520938,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499019,-99) ,
13, 1.95076, 0, 0, 0.505644,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502962,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457533,-99) ,
12, 1.08161, 0, 0, 0.496212,-99) ,
10, 0.306109, 1, 0, 0.501923,-99) ,
10, -2.14286, 1, 0, 0.502777,-99) );
// itree = 761
fBoostWeights.push_back(0.0151106);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.54494,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515686,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481122,-99) ,
12, 8.78378, 0, 0, 0.503867,-99) ,
8, 1.01278, 0, 0, 0.513294,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502131,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467694,-99) ,
7, 0.0237915, 1, 0, 0.500901,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469762,-99) ,
8, 1.20146, 0, 0, 0.49932,-99) ,
11, 5.51237, 0, 0, 0.501546,-99) );
// itree = 762
fBoostWeights.push_back(0.0245656);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.565307,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496631,-99) ,
12, 0.135729, 0, 0, 0.51617,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514228,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496129,-99) ,
9, -949.024, 0, 0, 0.501814,-99) ,
13, 2.00101, 0, 0, 0.50574,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507752,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480296,-99) ,
10, 1.65303, 1, 0, 0.50166,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459643,-99) ,
12, 1.17208, 0, 0, 0.4953,-99) ,
10, 0.428565, 1, 0, 0.502199,-99) );
// itree = 763
fBoostWeights.push_back(0.0186603);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 5.26221, 0, 1, 0.507124,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485632,-99) ,
8, 0.910752, 0, 0, 0.505051,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519293,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492735,-99) ,
3, 2.04265, 0, 0, 0.496683,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466478,-99) ,
12, 1.066, 0, 0, 0.492735,-99) ,
10, 0.428516, 1, 0, 0.500862,-99) );
// itree = 764
fBoostWeights.push_back(0.0176691);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.529884,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514875,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472137,-99) ,
12, 6.95377, 0, 0, 0.504862,-99) ,
8, 1.09152, 0, 0, 0.511289,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.547292,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49893,-99) ,
11, 1.96945, 0, 0, 0.501517,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457061,-99) ,
12, 3.84775, 1, 0, 0.499012,-99) ,
11, 3.80899, 0, 0, 0.501489,-99) );
// itree = 765
fBoostWeights.push_back(0.0260222);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.300116, 0, 1, 0.517407,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535358,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461027,-99) ,
12, 1.57786, 0, 0, 0.492405,-99) ,
10, 0.714363, 1, 0, 0.509399,-99) ,
NN(
NN(
0,
0,
-1, 1.85706, 0, 1, 0.504923,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510631,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479255,-99) ,
10, -1.10699, 1, 0, 0.488836,-99) ,
11, 0.150233, 0, 0, 0.499428,-99) ,
8, 2.11811, 0, 0, 0.501987,-99) );
// itree = 766
fBoostWeights.push_back(0.0156869);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 5.73368, 1, 1, 0.525352,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512091,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490213,-99) ,
10, 0.142123, 0, 0, 0.499788,-99) ,
13, 0.972015, 0, 0, 0.510772,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.548489,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499581,-99) ,
11, 1.96103, 0, 0, 0.501973,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.453727,-99) ,
12, 3.7545, 1, 0, 0.498917,-99) ,
11, 3.80945, 0, 0, 0.5013,-99) );
// itree = 767
fBoostWeights.push_back(0.0210891);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.25727, 0, 1, 0.509094,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510384,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476964,-99) ,
11, -2.93046, 1, 0, 0.489526,-99) ,
12, -0.405365, 0, 0, 0.505643,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523782,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494933,-99) ,
8, 2.27358, 0, 0, 0.499669,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461958,-99) ,
12, 0.537967, 0, 0, 0.496913,-99) ,
10, 0.142843, 1, 0, 0.5018,-99) );
// itree = 768
fBoostWeights.push_back(0.0150564);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538287,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504964,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492669,-99) ,
12, 2.8134, 1, 0, 0.501384,-99) ,
12, 9.6751, 0, 0, 0.502646,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.473709,-99) ,
8, 0.710625, 0, 0, 0.501521,-99) );
// itree = 769
fBoostWeights.push_back(0.0172478);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.539176,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494633,-99) ,
9, -949.113, 0, 0, 0.511819,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525554,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495052,-99) ,
10, -1.85715, 1, 0, 0.496707,-99) ,
5, 0.999524, 1, 0, 0.499134,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47619,-99) ,
4, 9.79955, 1, 0, 0.498299,-99) );
// itree = 770
fBoostWeights.push_back(0.028181);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.54536, 1, 1, 0.511826,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507879,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492897,-99) ,
11, 3.82705, 0, 0, 0.498715,-99) ,
13, 1.76027, 0, 0, 0.503363,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.570148,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476937,-99) ,
12, -0.660701, 0, 0, 0.506341,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511149,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455672,-99) ,
11, -1.60914, 0, 0, 0.47283,-99) ,
11, -2.25845, 1, 0, 0.489568,-99) ,
12, 0.222023, 0, 0, 0.500752,-99) );
// itree = 771
fBoostWeights.push_back(0.0060529);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.245202, 0, 1, 0.520602,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517975,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499862,-99) ,
2, -0.213464, 1, 0, 0.50095,-99) ,
4, 0.540379, 1, 0, 0.502093,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483029,-99) ,
4, 8.97397, 1, 0, 0.501194,-99) );
// itree = 772
fBoostWeights.push_back(0.00891234);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 9.65682, 0, 1, 0.502914,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479308,-99) ,
8, 0.70928, 0, 0, 0.501971,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476588,-99) ,
5, 0.997619, 0, 0, 0.500905,-99) );
// itree = 773
fBoostWeights.push_back(0.0198367);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508244,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.461975,-99) ,
10, 1.85708, 1, 0, 0.506114,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504486,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48491,-99) ,
3, 1.74153, 1, 0, 0.496945,-99) ,
9, -40.0028, 1, 0, 0.50284,-99) ,
NN(
0,
0,
-1, 0.444143, 0, -1, 0.477643,-99) ,
5, 0.998095, 0, 0, 0.501542,-99) );
// itree = 774
fBoostWeights.push_back(0.0168609);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519157,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492467,-99) ,
3, 1.10359, 0, 0, 0.512668,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481529,-99) ,
5, 0.999524, 0, 0, 0.508117,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523351,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492234,-99) ,
11, -1.69264, 1, 0, 0.508152,-99) ,
NN(
0,
0,
-1, 0.524378, 0, -1, 0.495659,-99) ,
3, 2.09346, 0, 0, 0.498023,-99) ,
10, -1, 1, 0, 0.499945,-99) );
// itree = 775
fBoostWeights.push_back(0.0164649);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526032,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502864,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.449272,-99) ,
12, 3.76513, 1, 0, 0.500818,-99) ,
11, 3.11246, 0, 0, 0.502669,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52558,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49121,-99) ,
13, 0.952943, 0, 0, 0.499312,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455967,-99) ,
11, 6.19303, 0, 0, 0.492315,-99) ,
8, 1.13136, 0, 0, 0.5009,-99) );
// itree = 776
fBoostWeights.push_back(0.0153204);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.100732, 1, 1, 0.517707,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487786,-99) ,
12, -0.64826, 0, 0, 0.509194,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533073,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499513,-99) ,
12, 5.52621, 1, 0, 0.506627,-99) ,
NN(
0,
0,
-1, 1.2933, 0, -1, 0.494391,-99) ,
11, 3.5259, 0, 0, 0.497473,-99) ,
8, 2.38038, 0, 0, 0.499333,-99) );
// itree = 777
fBoostWeights.push_back(0.0202647);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507534,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494749,-99) ,
8, 1.30809, 0, 0, 0.504474,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530378,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475835,-99) ,
11, 0.98951, 0, 0, 0.490829,-99) ,
7, 0.0011333, 0, 0, 0.502709,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503602,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457551,-99) ,
3, 1.09764, 1, 0, 0.483287,-99) ,
7, 0.0238014, 1, 0, 0.501507,-99) );
// itree = 778
fBoostWeights.push_back(0.0191009);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 7.45926, 0, 1, 0.518958,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513082,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480168,-99) ,
12, 12.637, 0, 0, 0.49487,-99) ,
13, 0.881285, 0, 0, 0.508553,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.513886,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497959,-99) ,
11, 0.424232, 0, 0, 0.501783,-99) ,
NN(
0,
0,
-1, -0.43714, 1, -1, 0.473547,-99) ,
8, 1.3827, 0, 0, 0.498555,-99) ,
11, 3.67998, 0, 0, 0.500612,-99) );
// itree = 779
fBoostWeights.push_back(0.0182537);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.3111, 0, 1, 0.503091,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504699,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.433365,-99) ,
12, 1.63769, 0, 0, 0.492822,-99) ,
10, 0.999952, 1, 0, 0.500961,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.543093,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47299,-99) ,
12, -1.04964, 0, 0, 0.50485,-99) ,
NN(
0,
0,
-1, -1.11066, 1, -1, 0.475085,-99) ,
11, -2.49364, 1, 0, 0.488934,-99) ,
12, -0.0224326, 0, 0, 0.499156,-99) );
// itree = 780
fBoostWeights.push_back(0.0192864);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.531297,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493956,-99) ,
11, -1.28871, 1, 0, 0.516708,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.516424,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476675,-99) ,
9, -0.121593, 1, 0, 0.492906,-99) ,
9, -10.0426, 1, 0, 0.506479,-99) ,
NN(
NN(
0,
0,
-1, 5.29547, 1, 1, 0.506675,-99) ,
NN(
0,
0,
-1, 1.26934, 0, -1, 0.494467,-99) ,
11, 3.51121, 0, 0, 0.497894,-99) ,
3, 1.93414, 0, 0, 0.500036,-99) );
// itree = 781
fBoostWeights.push_back(0.0193119);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.721275, 0, 1, 0.511901,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477653,-99) ,
8, 1.0752, 0, 0, 0.507198,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514202,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494228,-99) ,
8, 2.27309, 0, 0, 0.497322,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475279,-99) ,
12, -0.0393735, 0, 0, 0.49577,-99) ,
10, -0.714309, 1, 0, 0.498811,-99) );
// itree = 782
fBoostWeights.push_back(0.0148911);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.295717, 0, 1, 0.509785,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489832,-99) ,
3, 0.970833, 0, 0, 0.506908,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.519363,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496868,-99) ,
8, 2.5177, 0, 0, 0.498513,-99) ,
NN(
0,
0,
-1, 2.70088, 0, -1, 0.477216,-99) ,
12, 0.315635, 0, 0, 0.496446,-99) ,
10, -0.428609, 1, 0, 0.500189,-99) );
// itree = 783
fBoostWeights.push_back(0.0274126);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.26644, 1, 1, 0.519722,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506404,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.452626,-99) ,
10, 1.28574, 1, 0, 0.502031,-99) ,
11, 0.183017, 0, 0, 0.505855,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514267,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491097,-99) ,
9, -40.0028, 1, 0, 0.505432,-99) ,
NN(
0,
0,
-1, 0.639552, 0, -1, 0.474396,-99) ,
11, 2.03974, 0, 0, 0.495573,-99) ,
8, 1.54513, 0, 0, 0.501793,-99) );
// itree = 784
fBoostWeights.push_back(0.0185308);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506358,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493834,-99) ,
8, 1.2976, 0, 0, 0.503116,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511067,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45945,-99) ,
6, 0.440029, 0, 0, 0.481565,-99) ,
5, 0.998571, 0, 0, 0.501579,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509513,-99) ,
NN(
0,
0,
-1, 0.15964, 0, -1, 0.475301,-99) ,
3, 1.44174, 1, 0, 0.489509,-99) ,
9, 0.525285, 1, 0, 0.499959,-99) );
// itree = 785
fBoostWeights.push_back(0.0159564);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527195,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499709,-99) ,
8, 2.07699, 0, 0, 0.503377,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501239,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445839,-99) ,
12, 1.73885, 0, 0, 0.490632,-99) ,
10, 0.999961, 1, 0, 0.500676,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506973,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508077,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466988,-99) ,
10, -1.44449, 1, 0, 0.476636,-99) ,
11, -2.59247, 1, 0, 0.487392,-99) ,
12, 0.116956, 0, 0, 0.498383,-99) );
// itree = 786
fBoostWeights.push_back(0.0219434);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 8.13115, 0, 1, 0.516806,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491603,-99) ,
13, 0.788739, 0, 0, 0.508579,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.528618,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493414,-99) ,
7, 0.0113284, 0, 0, 0.497289,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.456015,-99) ,
7, 0.0237902, 1, 0, 0.49587,-99) ,
11, 4.02185, 0, 0, 0.498367,-99) );
// itree = 787
fBoostWeights.push_back(0.017748);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.57058,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489671,-99) ,
3, 1.09351, 0, 0, 0.529763,-99) ,
NN(
0,
0,
-1, -0.46938, 1, 1, 0.502912,-99) ,
10, -1.28572, 1, 0, 0.505431,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.542608,-99) ,
NN(
0,
0,
-1, 0.582214, 1, -1, 0.490243,-99) ,
12, 1.36335, 0, 0, 0.494661,-99) ,
11, -0.395026, 0, 0, 0.501094,-99) );
// itree = 788
fBoostWeights.push_back(0.0176739);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517785,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498806,-99) ,
13, 1.81762, 0, 0, 0.50366,-99) ,
NN(
0,
0,
-1, -0.351304, 1, -1, 0.492672,-99) ,
12, 0.361928, 0, 0, 0.501004,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530008,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483927,-99) ,
10, 1.85711, 0, 0, 0.502454,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.453383,-99) ,
11, 0.396896, 0, 0, 0.48428,-99) ,
10, 1.2857, 1, 0, 0.499037,-99) );
// itree = 789
fBoostWeights.push_back(0.020416);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.991578, 0, 1, 0.507986,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506712,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.463559,-99) ,
12, 5.76894, 0, 0, 0.494127,-99) ,
13, 1.14885, 0, 0, 0.505435,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506907,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491316,-99) ,
10, 1.16326, 1, 0, 0.499837,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.457379,-99) ,
12, 1.00749, 0, 0, 0.494783,-99) ,
10, 0.42856, 1, 0, 0.501802,-99) );
// itree = 790
fBoostWeights.push_back(0.0212574);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524381,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506934,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495894,-99) ,
10, 0.142782, 1, 0, 0.501568,-99) ,
8, 2.51753, 0, 0, 0.502971,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.550122,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467451,-99) ,
12, -1.0766, 0, 0, 0.505611,-99) ,
NN(
0,
0,
-1, -0.472361, 1, -1, 0.47759,-99) ,
11, -2.52319, 1, 0, 0.488574,-99) ,
12, 0.116956, 0, 0, 0.500506,-99) );
// itree = 791
fBoostWeights.push_back(0.0256828);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535034,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476821,-99) ,
12, -0.890836, 0, 0, 0.51595,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512279,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479118,-99) ,
11, 0.587564, 0, 0, 0.498186,-99) ,
8, 1.68701, 0, 0, 0.505871,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525162,-99) ,
NN(
0,
0,
-1, 0.0237973, 1, -1, 0.494058,-99) ,
12, 10.0293, 0, 0, 0.496496,-99) ,
10, -0.428617, 1, 0, 0.49985,-99) );
// itree = 792
fBoostWeights.push_back(0.0234255);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.671267, 1, 1, 0.510721,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506228,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492083,-99) ,
11, 4.25371, 0, 0, 0.499377,-99) ,
8, 1.5089, 0, 0, 0.505529,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526071,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483853,-99) ,
12, -0.774828, 0, 0, 0.508178,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504422,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471283,-99) ,
10, -1.72433, 1, 0, 0.479254,-99) ,
3, 2.2106, 0, 0, 0.49127,-99) ,
12, 0.281695, 0, 0, 0.502689,-99) );
// itree = 793
fBoostWeights.push_back(0.020229);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 3.38592, 1, 1, 0.514271,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502499,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480909,-99) ,
8, 1.65299, 0, 0, 0.497611,-99) ,
11, 1.40721, 0, 0, 0.50091,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526667,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488121,-99) ,
13, 0.870216, 0, 0, 0.499596,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464087,-99) ,
11, 7.7039, 0, 0, 0.490171,-99) ,
8, 1.12093, 0, 0, 0.499123,-99) );
// itree = 794
fBoostWeights.push_back(0.0173396);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.10462, 0, 1, 0.505022,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50022,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469927,-99) ,
12, 2.01947, 0, 0, 0.491565,-99) ,
10, 0.714244, 1, 0, 0.500744,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52385,-99) ,
NN(
0,
0,
-1, -0.0707931, 1, -1, 0.483824,-99) ,
11, -2.99624, 1, 0, 0.489934,-99) ,
12, 0.413866, 0, 0, 0.498355,-99) );
// itree = 795
fBoostWeights.push_back(0.00943613);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515371,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505022,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496759,-99) ,
11, 2.68905, 0, 0, 0.498876,-99) ,
3, 2.68748, 0, 0, 0.499549,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475962,-99) ,
2, 0.356712, 1, 0, 0.498903,-99) );
// itree = 796
fBoostWeights.push_back(0.0137688);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.466482, 0, 1, 0.514386,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500739,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469906,-99) ,
13, 0.721947, 0, 0, 0.498843,-99) ,
8, 2.10434, 0, 0, 0.502555,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501498,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483178,-99) ,
12, 5.63565, 1, 0, 0.496773,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.44746,-99) ,
12, 1.2464, 0, 0, 0.490561,-99) ,
10, 0.714272, 1, 0, 0.499537,-99) );
// itree = 797
fBoostWeights.push_back(0.0123567);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508302,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479942,-99) ,
10, -0.551048, 1, 0, 0.505194,-99) ,
NN(
0,
0,
-1, 0.184551, 0, -1, 0.496673,-99) ,
10, -0.428593, 1, 0, 0.499729,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480201,-99) ,
5, 0.997619, 0, 0, 0.498901,-99) );
// itree = 798
fBoostWeights.push_back(0.0340828);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.570184,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481082,-99) ,
10, 1.20801, 1, 0, 0.52248,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51418,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454385,-99) ,
10, 0.0961229, 1, 0, 0.497167,-99) ,
12, 0.713365, 0, 0, 0.505887,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510804,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492468,-99) ,
13, 1.26604, 0, 0, 0.50285,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517671,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478226,-99) ,
10, -1.68732, 1, 0, 0.48459,-99) ,
11, -0.178826, 0, 0, 0.497834,-99) ,
13, 2.10644, 0, 0, 0.499899,-99) );
// itree = 799
fBoostWeights.push_back(0.0165915);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.938477, 1, 1, 0.529863,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.482916,-99) ,
12, -0.295083, 0, 0, 0.509001,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.539757,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499279,-99) ,
10, 1.85704, 0, 0, 0.501892,-99) ,
NN(
0,
0,
-1, 1.80338, 0, -1, 0.490905,-99) ,
11, 0.644075, 0, 0, 0.496109,-99) ,
8, 2.56943, 0, 0, 0.497533,-99) );
// itree = 800
fBoostWeights.push_back(0.0113793);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520877,-99) ,
NN(
NN(
0,
0,
-1, 7.43316, 0, 1, 0.502641,-99) ,
NN(
0,
0,
-1, 5.54238, 1, -1, 0.488586,-99) ,
10, 0.714248, 1, 0, 0.499195,-99) ,
12, 10.8447, 0, 0, 0.500404,-99) );
// itree = 801
fBoostWeights.push_back(0.0183153);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.533063,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514907,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483427,-99) ,
10, -0.145156, 0, 0, 0.500912,-99) ,
13, 0.975732, 0, 0, 0.509901,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.542112,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496525,-99) ,
11, 2.79415, 0, 0, 0.498966,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.460418,-99) ,
12, 4.81123, 1, 0, 0.497346,-99) ,
11, 5.50074, 0, 0, 0.49937,-99) );
// itree = 802
fBoostWeights.push_back(0.0177244);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.575009,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496785,-99) ,
10, 0.534346, 1, 0, 0.518636,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526182,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499807,-99) ,
10, -1.28581, 1, 0, 0.502511,-99) ,
13, 1.99229, 0, 0, 0.50566,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508709,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478523,-99) ,
10, -0.277226, 1, 0, 0.499552,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46538,-99) ,
8, 1.836, 0, 0, 0.493896,-99) ,
12, 0.379125, 0, 0, 0.503132,-99) );
// itree = 803
fBoostWeights.push_back(0.01343);
fForest.push_back(
NN(
NN(
0,
0,
-1, -0.0716465, 1, 1, 0.504525,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509405,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.478209,-99) ,
12, -0.785131, 0, 0, 0.495608,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471265,-99) ,
10, -0.272006, 1, 0, 0.490955,-99) ,
12, 0.0998317, 0, 0, 0.50224,-99) );
// itree = 804
fBoostWeights.push_back(0.0199655);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.555528,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476105,-99) ,
10, 1.71977, 1, 0, 0.527819,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511266,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.468986,-99) ,
10, 0.416101, 1, 0, 0.500703,-99) ,
12, 1.40366, 0, 0, 0.507055,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51953,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499079,-99) ,
10, -1.85738, 1, 0, 0.500377,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.462563,-99) ,
5, 0.998572, 0, 0, 0.498925,-99) ,
3, 1.77479, 0, 0, 0.501663,-99) );
// itree = 805
fBoostWeights.push_back(0.023243);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.920991, 1, 1, 0.509118,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508453,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488163,-99) ,
11, 3.60819, 0, 0, 0.499902,-99) ,
13, 1.48746, 0, 0, 0.505043,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523842,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487721,-99) ,
12, -0.307171, 0, 0, 0.499545,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509178,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.467405,-99) ,
11, -1.62312, 0, 0, 0.479071,-99) ,
3, 2.08696, 0, 0, 0.489627,-99) ,
12, 0.222023, 0, 0, 0.502128,-99) );
// itree = 806
fBoostWeights.push_back(0.0144088);
fForest.push_back(
NN(
NN(
0,
0,
-1, -1.85709, 1, 1, 0.504778,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510416,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469475,-99) ,
12, -1.18902, 0, 0, 0.501296,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472795,-99) ,
10, -0.280014, 1, 0, 0.495086,-99) ,
12, 0.222023, 0, 0, 0.502941,-99) );
// itree = 807
fBoostWeights.push_back(0.0224558);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.289893, 1, 1, 0.514693,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.52408,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497208,-99) ,
10, 1.57134, 0, 0, 0.498876,-99) ,
13, 2.01591, 0, 0, 0.502016,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.552185,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.469269,-99) ,
12, -0.8622, 0, 0, 0.504851,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504444,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.464685,-99) ,
11, -1.62272, 0, 0, 0.477006,-99) ,
11, -2.29908, 1, 0, 0.489945,-99) ,
12, 0.239737, 0, 0, 0.4997,-99) );
// itree = 808
fBoostWeights.push_back(0.0192486);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.0862732, 1, 1, 0.510227,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504921,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.489479,-99) ,
11, 5.28528, 0, 0, 0.498746,-99) ,
3, 1.22129, 0, 0, 0.504477,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526387,-99) ,
NN(
0,
0,
-1, 0.679623, 1, -1, 0.49096,-99) ,
12, 1.52387, 0, 0, 0.494454,-99) ,
11, -0.122439, 0, 0, 0.499943,-99) );
// itree = 809
fBoostWeights.push_back(0.0184133);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.515115,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486817,-99) ,
8, 1.09697, 0, 0, 0.510998,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502443,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.477227,-99) ,
12, 0.149713, 0, 0, 0.499921,-99) ,
10, -0.551031, 1, 0, 0.503898,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501135,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510266,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.452996,-99) ,
12, 2.29659, 0, 0, 0.477099,-99) ,
11, 1.12574, 0, 0, 0.488826,-99) ,
10, 1.2857, 1, 0, 0.50211,-99) );
// itree = 810
fBoostWeights.push_back(0.0227979);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.115182, 0, 1, 0.513542,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523488,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48844,-99) ,
12, 6.09755, 0, 0, 0.49591,-99) ,
13, 1.58308, 0, 0, 0.505023,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523452,-99) ,
NN(
0,
0,
-1, 1.01311, 0, -1, 0.491905,-99) ,
8, 2.7582, 0, 0, 0.494549,-99) ,
10, -0.14291, 1, 0, 0.499312,-99) );
// itree = 811
fBoostWeights.push_back(0.0227704);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.3359, 0, 1, 0.514924,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503144,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485094,-99) ,
10, 1.36735, 1, 0, 0.499542,-99) ,
10, -0.428538, 1, 0, 0.503793,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.56099,-99) ,
NN(
0,
0,
-1, 0.647699, 1, -1, 0.487409,-99) ,
12, 1.40473, 0, 0, 0.492934,-99) ,
11, -0.395026, 0, 0, 0.499404,-99) );
// itree = 812
fBoostWeights.push_back(0.0162046);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.543744,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486482,-99) ,
13, 0.68334, 0, 0, 0.513718,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525917,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497019,-99) ,
11, 2.67227, 0, 0, 0.499511,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502198,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471438,-99) ,
6, -0.678283, 1, 0, 0.4823,-99) ,
8, 1.15164, 0, 0, 0.497477,-99) ,
12, 9.81898, 0, 0, 0.498589,-99) );
// itree = 813
fBoostWeights.push_back(0.015185);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.54867,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501917,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.459149,-99) ,
12, 2.99918, 1, 0, 0.50023,-99) ,
11, 1.69618, 0, 0, 0.503523,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507519,-99) ,
NN(
0,
0,
-1, 3.78439, 0, -1, 0.488716,-99) ,
12, 12.3797, 0, 0, 0.49179,-99) ,
12, 3.68141, 1, 0, 0.500507,-99) );
// itree = 814
fBoostWeights.push_back(0.0205555);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.567957,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492998,-99) ,
11, -1.84393, 1, 0, 0.52041,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491323,-99) ,
12, -0.483794, 0, 0, 0.510346,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517533,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498485,-99) ,
12, 3.23833, 1, 0, 0.504682,-99) ,
NN(
0,
0,
-1, 1.28559, 1, -1, 0.489693,-99) ,
11, 0.527801, 0, 0, 0.49724,-99) ,
3, 2.23668, 0, 0, 0.498941,-99) );
// itree = 815
fBoostWeights.push_back(0.015916);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.546616, 1, 1, 0.525142,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504754,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484647,-99) ,
12, -0.937449, 0, 0, 0.494166,-99) ,
12, -0.306972, 0, 0, 0.512889,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535655,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499388,-99) ,
11, 1.77724, 0, 0, 0.501995,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503729,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48233,-99) ,
11, 5.4975, 0, 0, 0.493454,-99) ,
13, 1.39978, 0, 0, 0.49885,-99) ,
8, 2.3804, 0, 0, 0.501084,-99) );
// itree = 816
fBoostWeights.push_back(0.0115921);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.525497,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512367,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498078,-99) ,
8, 2.17167, 0, 0, 0.501356,-99) ,
NN(
0,
0,
-1, 2.12528, 1, -1, 0.479423,-99) ,
10, 1.77542, 1, 0, 0.500194,-99) ,
10, -2.14287, 1, 0, 0.500962,-99) );
// itree = 817
fBoostWeights.push_back(0.0134266);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.550704,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498329,-99) ,
12, 0.881118, 0, 0, 0.5117,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502145,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487194,-99) ,
12, 0.708115, 0, 0, 0.49984,-99) ,
8, 2.14263, 0, 0, 0.502691,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476865,-99) ,
10, 2.14283, 1, 0, 0.50204,-99) );
// itree = 818
fBoostWeights.push_back(0.0125374);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.999524, 1, 1, 0.505174,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480144,-99) ,
4, 7.16537, 1, 0, 0.504038,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483897,-99) ,
4, 9.3665, 1, 0, 0.503197,-99) );
// itree = 819
fBoostWeights.push_back(0.0128107);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524661,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523179,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498299,-99) ,
0, 0.499042, 0, 0, 0.50919,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507156,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495804,-99) ,
8, 2.36246, 0, 0, 0.497654,-99) ,
2, -0.0714753, 1, 0, 0.499734,-99) ,
10, -2.14285, 1, 0, 0.500486,-99) );
// itree = 820
fBoostWeights.push_back(0.0126719);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537939,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503238,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47616,-99) ,
8, 1.06655, 0, 0, 0.501708,-99) ,
12, 8.08938, 0, 0, 0.503011,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483055,-99) ,
11, 14.362, 1, 0, 0.50173,-99) );
// itree = 821
fBoostWeights.push_back(0.0106686);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51738,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497609,-99) ,
4, 4.85092, 1, 0, 0.509975,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505529,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497601,-99) ,
13, 2.00101, 0, 0, 0.499996,-99) ,
2, 0.0712383, 0, 0, 0.501771,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475921,-99) ,
0, 0.489519, 0, 0, 0.50111,-99) );
// itree = 822
fBoostWeights.push_back(0.0206513);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5547,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498746,-99) ,
13, 1.24233, 0, 0, 0.526844,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512539,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49377,-99) ,
12, 11.0468, 0, 0, 0.499172,-99) ,
12, 4.96883, 1, 0, 0.506503,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506852,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492709,-99) ,
10, -0.142764, 1, 0, 0.499052,-99) ,
NN(
0,
0,
-1, 2.20724, 1, -1, 0.46789,-99) ,
8, 1.39804, 0, 0, 0.496333,-99) ,
11, 2.43801, 0, 0, 0.498944,-99) );
// itree = 823
fBoostWeights.push_back(0.0174586);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.509358,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485014,-99) ,
12, -0.636169, 0, 0, 0.505662,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.502327,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466326,-99) ,
12, 0.751057, 0, 0, 0.497384,-99) ,
10, -0.0612607, 1, 0, 0.501507,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479214,-99) ,
10, 2.1428, 1, 0, 0.500941,-99) );
// itree = 824
fBoostWeights.push_back(0.00867617);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.537431,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501366,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476658,-99) ,
7, 0.0237973, 1, 0, 0.500195,-99) ,
12, 9.4985, 0, 0, 0.501566,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479589,-99) ,
8, 0.70915, 0, 0, 0.500723,-99) );
// itree = 825
fBoostWeights.push_back(0.0249036);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.583493,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496311,-99) ,
10, 0.665838, 1, 0, 0.518964,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50475,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.454824,-99) ,
10, 0.120827, 1, 0, 0.49373,-99) ,
12, 0.6251, 0, 0, 0.504114,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538493,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495842,-99) ,
13, 1.38805, 0, 0, 0.515876,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.50207,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486163,-99) ,
11, 2.05882, 0, 0, 0.492983,-99) ,
10, -1.57155, 1, 0, 0.495239,-99) ,
13, 1.99521, 0, 0, 0.49798,-99) );
// itree = 826
fBoostWeights.push_back(0.0143075);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.534503,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.51276,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497282,-99) ,
10, -1.00003, 1, 0, 0.49934,-99) ,
13, 2.69287, 0, 0, 0.500568,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507336,-99) ,
NN(
0,
0,
-1, -0.378292, 1, -1, 0.482081,-99) ,
3, 2.52389, 0, 0, 0.487747,-99) ,
12, 0.26054, 0, 0, 0.498065,-99) );
// itree = 827
fBoostWeights.push_back(0.020787);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.591354,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499923,-99) ,
11, -1.8018, 1, 0, 0.509514,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506857,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.49284,-99) ,
11, 2.58701, 0, 0, 0.499377,-99) ,
8, 1.76251, 0, 0, 0.503308,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.520305,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475764,-99) ,
12, -1.12625, 0, 0, 0.501247,-99) ,
NN(
0,
0,
-1, 2.69866, 0, -1, 0.470121,-99) ,
10, -0.930308, 1, 0, 0.487711,-99) ,
12, -0.129857, 0, 0, 0.501197,-99) );
// itree = 828
fBoostWeights.push_back(0.0201005);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535134,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497003,-99) ,
10, 0.280134, 1, 0, 0.511337,-99) ,
NN(
0,
0,
-1, 0.999048, 0, -1, 0.498158,-99) ,
13, 1.72145, 0, 0, 0.503387,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.535766,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480592,-99) ,
11, -2.32132, 1, 0, 0.498462,-99) ,
NN(
0,
0,
-1, -2.95974, 1, -1, 0.472298,-99) ,
12, -0.810839, 0, 0, 0.488674,-99) ,
12, 0.0238724, 0, 0, 0.501067,-99) );
// itree = 829
fBoostWeights.push_back(0.0159235);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.549403,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505029,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.488263,-99) ,
12, 4.2581, 1, 0, 0.502491,-99) ,
12, 9.0212, 0, 0, 0.503957,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.481964,-99) ,
13, 0.74553, 0, 0, 0.502795,-99) );
// itree = 830
fBoostWeights.push_back(0.0216712);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.09329, 1, 1, 0.509191,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505661,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486422,-99) ,
11, 7.45709, 0, 0, 0.496343,-99) ,
13, 1.28979, 0, 0, 0.505115,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508349,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484065,-99) ,
12, -0.471786, 0, 0, 0.496859,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.46244,-99) ,
10, -0.000733693, 1, 0, 0.491314,-99) ,
12, 0.441421, 0, 0, 0.501967,-99) );
// itree = 831
fBoostWeights.push_back(0.0148497);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 2.08464, 1, 1, 0.50978,-99) ,
NN(
0,
0,
-1, 1.55696, 0, -1, 0.496237,-99) ,
11, 0.0596593, 0, 0, 0.50272,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503222,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471174,-99) ,
11, 20.8155, 0, 0, 0.485893,-99) ,
13, 0.829322, 0, 0, 0.50146,-99) );
// itree = 832
fBoostWeights.push_back(0.0170234);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.73079, 1, 1, 0.510528,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501482,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.452226,-99) ,
13, 1.51775, 0, 0, 0.498784,-99) ,
11, 0.117639, 0, 0, 0.503549,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510815,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490058,-99) ,
11, 12.9695, 1, 0, 0.500183,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.445876,-99) ,
12, 5.76894, 0, 0, 0.491118,-99) ,
13, 1.11852, 0, 0, 0.50146,-99) );
// itree = 833
fBoostWeights.push_back(0.0273241);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.55776,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496907,-99) ,
10, 0.551528, 1, 0, 0.513172,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.517136,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496377,-99) ,
10, -1.57144, 1, 0, 0.497657,-99) ,
13, 2.01591, 0, 0, 0.500497,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.565837,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.471962,-99) ,
12, -0.513947, 0, 0, 0.498223,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.523623,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.458828,-99) ,
11, -1.35745, 0, 0, 0.474333,-99) ,
11, -2.1522, 1, 0, 0.48597,-99) ,
12, 0.400445, 0, 0, 0.497309,-99) );
// itree = 834
fBoostWeights.push_back(0.019563);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.98704, 1, 1, 0.512016,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504073,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479319,-99) ,
8, 1.72836, 0, 0, 0.499459,-99) ,
11, 0.268564, 0, 0, 0.504782,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504127,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.472072,-99) ,
10, -0.141785, 0, 0, 0.4896,-99) ,
8, 0.920978, 0, 0, 0.503296,-99) );
// itree = 835
fBoostWeights.push_back(0.015283);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -0.379127, 0, 1, 0.513127,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.476577,-99) ,
3, 0.962221, 0, 0, 0.508302,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514996,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499143,-99) ,
3, 1.60516, 0, 0, 0.503451,-99) ,
NN(
0,
0,
-1, 0.556539, 1, -1, 0.491223,-99) ,
12, 1.25862, 0, 0, 0.499498,-99) ,
10, -1, 1, 0, 0.501186,-99) );
// itree = 836
fBoostWeights.push_back(0.0173289);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.553168,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495501,-99) ,
10, 0.849962, 1, 0, 0.520661,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.505084,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.495452,-99) ,
11, 1.21538, 0, 0, 0.499856,-99) ,
8, 2.39366, 0, 0, 0.501705,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514947,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483628,-99) ,
12, -1.14063, 0, 0, 0.502981,-99) ,
NN(
0,
0,
-1, 2.60611, 0, -1, 0.475408,-99) ,
10, -0.8643, 1, 0, 0.490946,-99) ,
12, 0.0205099, 0, 0, 0.500017,-99) );
// itree = 837
fBoostWeights.push_back(0.0166794);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 4.25454, 0, 1, 0.505285,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487469,-99) ,
3, 0.812519, 0, 0, 0.503664,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.506391,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485372,-99) ,
10, 1.65305, 1, 0, 0.501746,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.45963,-99) ,
12, 1.17208, 0, 0, 0.495466,-99) ,
10, 0.42856, 1, 0, 0.500884,-99) );
// itree = 838
fBoostWeights.push_back(0.0200655);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.52909, 1, 1, 0.512321,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507041,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.493239,-99) ,
11, 3.50168, 0, 0, 0.498465,-99) ,
13, 1.80826, 0, 0, 0.503197,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.508093,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.485625,-99) ,
12, -0.878271, 0, 0, 0.497627,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.465525,-99) ,
10, -0.542966, 1, 0, 0.488892,-99) ,
12, -0.0224326, 0, 0, 0.50105,-99) );
// itree = 839
fBoostWeights.push_back(0.0168432);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.548364,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.499613,-99) ,
12, -0.167243, 0, 0, 0.517671,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.484797,-99) ,
11, -1.45357, 1, 0, 0.508333,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522459,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497816,-99) ,
8, 2.02211, 0, 0, 0.500535,-99) ,
NN(
0,
0,
-1, -0.239893, 1, -1, 0.48352,-99) ,
12, 0.778428, 0, 0, 0.496791,-99) ,
3, 2.22639, 0, 0, 0.498308,-99) );
// itree = 840
fBoostWeights.push_back(0.0255402);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, -1.40399, 1, 1, 0.508613,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.507563,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.490673,-99) ,
11, 7.04067, 0, 0, 0.497653,-99) ,
13, 1.42262, 0, 0, 0.504174,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.538876,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.480062,-99) ,
12, -1.08887, 0, 0, 0.509937,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.530672,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.47396,-99) ,
11, -1.41369, 0, 0, 0.485654,-99) ,
11, -2.45573, 1, 0, 0.49392,-99) ,
12, 0.379125, 0, 0, 0.501959,-99) );
// itree = 841
fBoostWeights.push_back(0.0183895);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.44866, 0, 1, 0.50561,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.504885,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.466235,-99) ,
12, 7.74441, 0, 0, 0.488579,-99) ,
13, 1.0834, 0, 0, 0.502947,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.512152,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.491893,-99) ,
13, 2.07104, 0, 0, 0.496561,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455125,-99) ,
12, 1.3802, 0, 0, 0.49022,-99) ,
10, 0.714218, 1, 0, 0.499745,-99) );
// itree = 842
fBoostWeights.push_back(0.0134873);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 3.93304, 1, 1, 0.509939,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500114,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483202,-99) ,
8, 1.65726, 0, 0, 0.495725,-99) ,
11, 1.83608, 0, 0, 0.499257,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.479548,-99) ,
11, 14.3234, 1, 0, 0.498001,-99) );
// itree = 843
fBoostWeights.push_back(0.0162778);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524913,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510098,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.48965,-99) ,
5, 0.999524, 1, 0, 0.497715,-99) ,
6, 0.469457, 1, 0, 0.508774,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.503548,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.494545,-99) ,
8, 1.38694, 0, 0, 0.499705,-99) ,
NN(
0,
0,
-1, -0.0970016, 1, -1, 0.483976,-99) ,
12, 0.840957, 0, 0, 0.495958,-99) ,
8, 2.56927, 0, 0, 0.497369,-99) );
// itree = 844
fBoostWeights.push_back(0.0184624);
fForest.push_back(
NN(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526858,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497243,-99) ,
11, -0.558758, 0, 0, 0.508999,-99) ,
NN(
0,
0,
-1, -0.693838, 1, -1, 0.485277,-99) ,
8, 1.12135, 0, 0, 0.505225,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.518411,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.500496,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486357,-99) ,
10, 0.550994, 1, 0, 0.493917,-99) ,
12, 11.6743, 0, 0, 0.495356,-99) ,
10, -0.428588, 1, 0, 0.498872,-99) );
// itree = 845
fBoostWeights.push_back(0.0182894);
fForest.push_back(
NN(
NN(
0,
0,
-1, -0.375001, 1, 1, 0.512899,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.522256,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.492495,-99) ,
12, -0.350636, 0, 0, 0.510225,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.501973,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.487526,-99) ,
11, 1.00156, 0, 0, 0.493817,-99) ,
8, 2.60426, 0, 0, 0.495565,-99) ,
10, -1.57144, 1, 0, 0.497038,-99) );
// itree = 846
fBoostWeights.push_back(0.0175046);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.524514,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.510724,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.486984,-99) ,
12, -0.0516651, 0, 0, 0.497339,-99) ,
6, 0.477462, 1, 0, 0.508717,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.5239,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496158,-99) ,
11, -0.272991, 0, 0, 0.508427,-99) ,
NN(
0,
0,
-1, -0.0612358, 1, -1, 0.49308,-99) ,
10, -1.28572, 1, 0, 0.495133,-99) ,
8, 2.56929, 0, 0, 0.496636,-99) );
// itree = 847
fBoostWeights.push_back(0.0183874);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 1.43894, 0, 1, 0.511105,-99) ,
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.527934,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.496197,-99) ,
8, 2.70002, 0, 0, 0.497606,-99) ,
10, -0.428617, 1, 0, 0.501217,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511476,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.483647,-99) ,
3, 2.08286, 0, 0, 0.495577,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.455089,-99) ,
10, -0.0708057, 1, 0, 0.488868,-99) ,
12, 0.332721, 0, 0, 0.498659,-99) );
// itree = 848
fBoostWeights.push_back(0.0185077);
fForest.push_back(
NN(
NN(
NN(
0,
0,
-1, 0.386161, 0, 1, 0.515423,-99) ,
NN(
0,
0,
-1, 1.03244, 0, -1, 0.480858,-99) ,
13, 1.23316, 0, 0, 0.50778,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.526985,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.498295,-99) ,
12, 2.59666, 1, 0, 0.503353,-99) ,
NN(
0,
0,
-1, 1.40813, 1, -1, 0.492713,-99) ,
11, 0.267001, 0, 0, 0.498323,-99) ,
10, -0.714309, 1, 0, 0.500856,-99) );
// itree = 849
fBoostWeights.push_back(0.012012);
fForest.push_back(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.514341,-99) ,
NN(
NN(
NN(
0,
0,
-1, 0, 1, 1, 0.511606,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.497639,-99) ,
11, 1.59241, 0, 0, 0.500978,-99) ,
NN(
0,
0,
-1, 0, 1, -1, 0.475457,-99) ,
13, 0.913432, 0, 0, 0.499733,-99) ,
12, 11.2502, 0, 0, 0.500498,-99) );
return;
};
// Clean up
inline void ReadBDT_LHC19c2a_2_4::Clear()
{
for (unsigned int itree=0; itree<fForest.size(); itree++) {
delete fForest[itree];
}
}
inline double ReadBDT_LHC19c2a_2_4::GetMvaValue( const std::vector<double>& inputValues ) const
{
// classifier response value
double retval = 0;
// classifier response, sanity check first
if (!IsStatusClean()) {
std::cout << "Problem in class \"" << fClassName << "\": cannot return classifier response"
<< " because status is dirty" << std::endl;
retval = 0;
}
else {
retval = GetMvaValue__( inputValues );
}
return retval;
}
// Added by ALICE analyzer
extern "C"
{
ReadBDT_LHC19c2a_2_4 *ReadBDT_maker_LHC19c2a_2_4(std::vector<std::string> theInpVar)
{
return new ReadBDT_LHC19c2a_2_4(theInpVar);
}
}
| 14.807665 | 100 | 0.4939 | [
"vector"
] |
d0446b55ae610b148eee7008f71a392eea47481d | 1,306 | cpp | C++ | src/Parser.cpp | kbiscanic/bioinformatics | b6fd4344efa465578a9dcbdbc5a7dfd6ce722744 | [
"MIT"
] | null | null | null | src/Parser.cpp | kbiscanic/bioinformatics | b6fd4344efa465578a9dcbdbc5a7dfd6ce722744 | [
"MIT"
] | null | null | null | src/Parser.cpp | kbiscanic/bioinformatics | b6fd4344efa465578a9dcbdbc5a7dfd6ce722744 | [
"MIT"
] | null | null | null | #include "Parser.hpp"
#include <iostream>
// contructor for parser; takes string filename which should be full path to .fa
// file
Parser::Parser(const char* filename) {
Parser::in_.open(filename, ifstream::in);
};
// destructor, close input stream on destruction
Parser::~Parser() { in_.close(); }
// reads sequences from file and returns them in a vector
const vector<Sequence*> Parser::readSequences() {
vector<Sequence*> sequences;
while (!Parser::in_.eof()) {
string line;
getline(Parser::in_, line);
if (line.size() == 0) continue;
string identifier;
string sequence;
if (line.at(0) == '>') {
identifier = line.substr(1, line.find_first_of(" \n|") - 1);
char next = Parser::in_.peek();
while (next != '>' && !Parser::in_.eof()) {
getline(Parser::in_, line);
sequence += line;
next = Parser::in_.peek();
}
} else {
continue;
}
Sequence* seq = new Sequence(identifier, sequence);
sequences.push_back(seq);
}
return sequences;
};
/* 'Unit' test
int main()
{
Parser p("test/data/Escherichia_coli.GCA_000967155.1.30.dna.toplevel.fa");
vector<Sequence*> sequences = p.readSequences();
cout << sequences.size();
}
*/
| 22.135593 | 81 | 0.594181 | [
"vector"
] |
d04df9ab9e51762fcd9fd4a0c27866746c3e39a4 | 7,169 | cxx | C++ | panda/src/parametrics/nurbsCurveEvaluator.cxx | sean5470/panda3d | ea2d4fecd4af1d4064c5fe2ae2a902ef4c9b903d | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | panda/src/parametrics/nurbsCurveEvaluator.cxx | sean5470/panda3d | ea2d4fecd4af1d4064c5fe2ae2a902ef4c9b903d | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | panda/src/parametrics/nurbsCurveEvaluator.cxx | sean5470/panda3d | ea2d4fecd4af1d4064c5fe2ae2a902ef4c9b903d | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | /**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file nurbsCurveEvaluator.cxx
* @author drose
* @date 2002-12-03
*/
#include "nurbsCurveEvaluator.h"
/**
*
*/
NurbsCurveEvaluator::
NurbsCurveEvaluator() {
_order = 4;
_knots_dirty = true;
_basis_dirty = true;
}
/**
*
*/
NurbsCurveEvaluator::
~NurbsCurveEvaluator() {
}
/**
* Resets all the vertices and knots to their default values, and sets the
* curve up with the indicated number of vertices. You must then call
* set_vertex() repeatedly to fill in all of the vertex values appropriately.
*/
void NurbsCurveEvaluator::
reset(int num_vertices) {
_vertices.clear();
_vertices.reserve(num_vertices);
for (int i = 0; i < num_vertices; i++) {
_vertices.push_back(NurbsVertex());
}
_knots_dirty = true;
_basis_dirty = true;
}
/**
* Returns the coordinate space of the nth control vertex of the curve,
* expressed as a NodePath.
*/
NodePath NurbsCurveEvaluator::
get_vertex_space(int i, const NodePath &rel_to) const {
#ifndef NDEBUG
static NodePath empty_node_path;
nassertr(i >= 0 && i < (int)_vertices.size(), empty_node_path);
#endif
return _vertices[i].get_space(rel_to);
}
/**
* Simultaneously sets several extended values in the slots d through (d +
* num_values - 1) from the num_values elements of the indicated array. This
* is equivalent to calling set_extended_vertex() num_values times. See
* set_extended_vertex().
*/
void NurbsCurveEvaluator::
set_extended_vertices(int i, int d, const PN_stdfloat values[], int num_values) {
nassertv(i >= 0 && i < (int)_vertices.size());
NurbsVertex &vertex = _vertices[i];
for (int n = 0; n < num_values; n++) {
vertex.set_extended_vertex(d + n, values[n]);
}
}
/**
* Sets the value of the nth knot. Each knot value should be greater than or
* equal to the preceding value. If no knot values are set, a default knot
* vector is supplied.
*/
void NurbsCurveEvaluator::
set_knot(int i, PN_stdfloat knot) {
if (_knots_dirty) {
recompute_knots();
}
nassertv(i >= 0 && i < (int)_knots.size());
_knots[i] = knot;
}
/**
* Returns the value of the nth knot.
*/
PN_stdfloat NurbsCurveEvaluator::
get_knot(int i) const {
if (_knots_dirty) {
((NurbsCurveEvaluator *)this)->recompute_knots();
}
nassertr(i >= 0 && i < (int)_knots.size(), 0.0f);
return _knots[i];
}
/**
* Normalizes the knot sequence so that the parametric range of the curve is 0
* .. 1.
*/
void NurbsCurveEvaluator::
normalize_knots() {
if (_knots_dirty) {
recompute_knots();
}
if (get_num_vertices() > _order - 1) {
double min_value = _knots[_order - 1];
double max_value = _knots[get_num_vertices()];
double range = (max_value - min_value);
for (Knots::iterator ki = _knots.begin(); ki != _knots.end(); ++ki) {
(*ki) = ((*ki) - min_value) / range;
}
_basis_dirty = true;
}
}
/**
* Returns a NurbsCurveResult object that represents the result of applying
* the knots to all of the current values of the vertices, transformed into
* the indicated coordinate space.
*/
PT(NurbsCurveResult) NurbsCurveEvaluator::
evaluate(const NodePath &rel_to) const {
if (_basis_dirty) {
((NurbsCurveEvaluator *)this)->recompute_basis();
}
// First, transform the vertices as appropriate.
Vert4Array vecs;
get_vertices(vecs, rel_to);
// And apply those transformed vertices to the basis matrices to derive the
// result.
return new NurbsCurveResult(_basis, &vecs[0], &_vertices[0],
(int)_vertices.size());
}
/**
* Returns a NurbsCurveResult object that represents the result of applying
* the knots to all of the current values of the vertices, transformed into
* the indicated coordinate space, and then further transformed by the
* indicated matrix.
*/
PT(NurbsCurveResult) NurbsCurveEvaluator::
evaluate(const NodePath &rel_to, const LMatrix4 &mat) const {
if (_basis_dirty) {
((NurbsCurveEvaluator *)this)->recompute_basis();
}
// First, transform the vertices as appropriate.
Vert4Array vecs;
get_vertices(vecs, rel_to);
// And then apply the indicated matrix.
Vert4Array::iterator vi;
for (vi = vecs.begin(); vi != vecs.end(); ++vi) {
(*vi) = (*vi) * mat;
}
// And apply those transformed vertices to the basis matrices to derive the
// result.
return new NurbsCurveResult(_basis, &vecs[0], &_vertices[0],
(int)_vertices.size());
}
/**
*
*/
void NurbsCurveEvaluator::
output(ostream &out) const {
out << "NurbsCurve, " << get_num_knots() << " knots.";
}
/**
* Fills the indicated vector with the set of vertices in the curve,
* transformed to the given space. This flavor returns the vertices in
* 4-dimensional homogenous space.
*/
void NurbsCurveEvaluator::
get_vertices(NurbsCurveEvaluator::Vert4Array &verts, const NodePath &rel_to) const {
int num_vertices = (int)_vertices.size();
verts.reserve(verts.size() + num_vertices);
int vi;
for (vi = 0; vi < num_vertices; vi++) {
verts.push_back(get_vertex(vi, rel_to));
}
}
/**
* Fills the indicated vector with the set of vertices in the curve,
* transformed to the given space. This flavor returns the vertices in
* 3-dimensional space.
*/
void NurbsCurveEvaluator::
get_vertices(NurbsCurveEvaluator::Vert3Array &verts, const NodePath &rel_to) const {
int num_vertices = (int)_vertices.size();
verts.reserve(verts.size() + num_vertices);
int vi;
for (vi = 0; vi < num_vertices; vi++) {
LVecBase4 vertex = get_vertex(vi, rel_to);
// Avoid division by zero
if (vertex[3] == 0.0) {
verts.push_back(LPoint3(vertex[0], vertex[1], vertex[2]));
} else {
LPoint3 v3(vertex[0] / vertex[3], vertex[1] / vertex[3], vertex[2] / vertex[3]);
verts.push_back(v3);
}
}
}
/**
* Creates a default knot vector.
*/
void NurbsCurveEvaluator::
recompute_knots() {
_knots.clear();
int num_knots = get_num_knots();
_knots.reserve(num_knots);
PN_stdfloat value = 0.0f;
int i = 0;
while (i < _order) {
_knots.push_back(value);
i++;
}
while (i < num_knots - _order) {
value += 1.0f;
_knots.push_back(value);
i++;
}
value += 1.0f;
while (i < num_knots) {
_knots.push_back(value);
i++;
}
_knots_dirty = false;
}
/**
* Recomputes the basis matrices according to the knot vector.
*/
void NurbsCurveEvaluator::
recompute_basis() {
if (_knots_dirty) {
((NurbsCurveEvaluator *)this)->recompute_knots();
}
_basis.clear(_order);
if ((int)_vertices.size() > _order - 1) {
int min_knot = _order;
int max_knot = (int)_vertices.size();
for (int i = min_knot; i <= max_knot; i++) {
nassertv(i - 1 >= 0 && i < (int)_knots.size());
if (_knots[i - 1] < _knots[i]) {
// Here's a non-empty segment.
_basis.append_segment(i - _order, &_knots[i - _order]);
}
}
}
_basis_dirty = false;
}
| 25.880866 | 86 | 0.668434 | [
"object",
"vector",
"transform",
"3d"
] |
d04e45c307140646eeb726e5125a803c4cb8cb8b | 9,264 | cc | C++ | ydin/PiiThreadedProcessor.cc | topiolli/into | f0a47736f5c93dd32e89e7aad34152ae1afc5583 | [
"BSD-3-Clause"
] | 14 | 2015-01-19T22:14:18.000Z | 2020-04-13T23:27:20.000Z | ydin/PiiThreadedProcessor.cc | topiolli/into | f0a47736f5c93dd32e89e7aad34152ae1afc5583 | [
"BSD-3-Clause"
] | null | null | null | ydin/PiiThreadedProcessor.cc | topiolli/into | f0a47736f5c93dd32e89e7aad34152ae1afc5583 | [
"BSD-3-Clause"
] | 14 | 2015-01-16T05:43:15.000Z | 2019-01-29T07:57:11.000Z | /* This file is part of Into.
* Copyright (C) Intopii 2013.
* All rights reserved.
*
* Licensees holding a commercial Into license may use this file in
* accordance with the commercial license agreement. Please see
* LICENSE.commercial for commercial licensing terms.
*
* Alternatively, this file may be used under the terms of the GNU
* Affero General Public License version 3 as published by the Free
* Software Foundation. In addition, Intopii gives you special rights
* to use Into as a part of open source software projects. Please
* refer to LICENSE.AGPL3 for details.
*/
#include "PiiDefaultOperation.h"
#include "PiiThreadedProcessor.h"
PiiThreadedProcessor::PiiThreadedProcessor(PiiDefaultOperation* parent) :
PiiOperationProcessor(parent),
_inputCondition(PiiWaitCondition::NoQueue), _priority(InheritPriority),
_pStateMutex(parent->stateLock())
{
// Set state to stopped once the thread finishes execution
// DirectConnection ensures that the we don't need to run an event loop.
connect(this, SIGNAL(finished()), SLOT(setStopped()), Qt::DirectConnection);
}
void PiiThreadedProcessor::setProcessingPriority(QThread::Priority priority)
{
_priority = priority;
if (isRunning())
setPriority(priority);
}
QThread::Priority PiiThreadedProcessor::processingPriority() const
{
return _priority;
}
void PiiThreadedProcessor::setStopped()
{
// The runner has finished. Our state is (or at least should be)
// Stopping now
synchronized (_pStateMutex)
// Change to Stopped state.
_pParentOp->setState(PiiOperation::Stopped);
}
void PiiThreadedProcessor::check(bool reset)
{
// If the processor is being reset, we clear any pending signals.
if (reset)
_inputCondition.wakeAll();
_bMustReconfigure = false;
_strPropertySetName = QString();
}
void PiiThreadedProcessor::start()
{
QMutexLocker lock(_pStateMutex);
setObjectName(_pParentOp->objectName());
// If the state is Stopped, the thread must be started again. Once
// it starts, the state will be changed to Running.
if (_pParentOp->state() == PiiOperation::Stopped)
{
_pParentOp->setState(PiiOperation::Starting);
// Start the thread
QThread::start(_priority);
}
// If the state is Paused, the thread is just suspended and does not
// need to be restarted.
else if (_pParentOp->state() == PiiOperation::Paused)
{
// Wake it up.
_inputCondition.wakeOne();
}
}
void PiiThreadedProcessor::interrupt()
{
synchronized (_pStateMutex)
{
if (_pParentOp->state() != PiiOperation::Stopped)
_pParentOp->setState(PiiOperation::Interrupted);
}
// This ensures the signal is handled even if runner is waiting for
// input.
_inputCondition.wakeOne();
}
void PiiThreadedProcessor::pause()
{
QMutexLocker lock(_pStateMutex);
if (_pParentOp->state() != PiiOperation::Running)
return;
_pParentOp->setState(PiiOperation::Pausing);
}
void PiiThreadedProcessor::reconfigure(const QString& propertySetName)
{
_strPropertySetName = propertySetName;
_bMustReconfigure = true;
}
void PiiThreadedProcessor::stop()
{
QMutexLocker lock(_pStateMutex);
if (_pParentOp->state() != PiiOperation::Running)
return;
_pParentOp->setState(PiiOperation::Stopping);
}
bool PiiThreadedProcessor::wait(unsigned long time)
{
return QThread::wait(time);
}
bool PiiThreadedProcessor::tryToReceive(PiiAbstractInputSocket* sender,
const PiiVariant& object) throw ()
{
QMutexLocker inputLock(_pStateMutex);
PiiInputSocket* pInput = static_cast<PiiInputSocket*>(sender);
if (pInput->canReceive())
{
pInput->receive(object);
// Send a signal to start the next round of processing and
// return immediately.
_inputCondition.wakeOne();
return true;
}
return false;
}
void PiiThreadedProcessor::prepareAndProcess()
{
// This lock ensures that no input socket is able to take in objects
// for a while. They are thus unable to signal objectAccepted(),
// which means that _inputCondition.wakeOne() won't be called. Since
// we are going to process any object received so far, it is safe to
// reset the input condition.
QMutexLocker lock(_pStateMutex);
while (true)
{
_inputCondition.wakeAll();
//qDebug("%s: calling flow controller", qPrintable(objectName()));
PiiFlowController::FlowState state = _pFlowController->prepareProcess(); // may throw
//qDebug("%s: flow controller returned %d", qPrintable(objectName()), int(state));
if (state == PiiFlowController::IncompleteState)
return;
lock.unlock();
_pParentOp->sendSyncEvents(_pFlowController);
switch (state)
{
case PiiFlowController::ProcessableState:
_pParentOp->processLocked();
case PiiFlowController::SynchronizedState:
case PiiFlowController::IncompleteState:
break;
case PiiFlowController::ReconfigurableState:
_pParentOp->applyPropertySet(_pFlowController->propertySetName()); // may throw
break;
case PiiFlowController::PausedState:
_pParentOp->operationPaused(); // throws
case PiiFlowController::FinishedState:
_pParentOp->operationStopped(); // throws
case PiiFlowController::ResumedState:
_pParentOp->operationResumed(); // may throw
break;
}
lock.relock();
}
}
void PiiThreadedProcessor::run()
{
synchronized (_pStateMutex)
{
// State may have changed before we could even start. In such a
// case we won't turn into Running.
if (_pParentOp->state() == PiiOperation::Starting)
_pParentOp->setState(PiiOperation::Running);
}
// Run the loop until we get an interrupt signal.
while (_pParentOp->state() != PiiOperation::Interrupted)
{
try
{
// If a flow controller exists, we wait until an object is
// received.
if (_pFlowController != 0)
{
_inputCondition.wait();
// If the waiting was terminated by interrupt(), kill
// the thread.
if (_pParentOp->state() == PiiOperation::Interrupted)
return;
prepareAndProcess();
}
// If no input is connected, just process without waiting
// for input.
else
{
_pParentOp->processLocked();
synchronized (_pStateMutex)
if (_bMustReconfigure)
{
_pParentOp->applyPropertySet(_strPropertySetName);
_bMustReconfigure = false;
}
// If this operation is a producer (not driven by input), it
// needs to pause spontaneously
if (_pParentOp->state() == PiiOperation::Pausing)
_pParentOp->operationPaused(); // throws
else if (_pParentOp->state() == PiiOperation::Stopping)
_pParentOp->operationStopped(); // throws
}
}
catch (PiiExecutionException& ex)
{
_pStateMutex->lock();
// If the operation was paused, we change its state to
// Paused.
if (ex.code() == PiiExecutionException::Paused &&
_pParentOp->state() != PiiOperation::Interrupted)
{
_pParentOp->setState(PiiOperation::Paused);
_pStateMutex->unlock();
// Suspend the thread.
_inputCondition.wait();
// Suspension finished. Now change state back to
// running. But only if we haven't been interrupted...
_pStateMutex->lock();
if (_pParentOp->state() == PiiOperation::Paused)
{
// If there are no connected inputs, we are a
// producer and must send resume tags immediately.
if (_pFlowController == 0)
{
try { _pParentOp->operationResumed(); } catch (...) {}
}
else
// Ensure that input queues will be emptied if
// something was there before pause.
_inputCondition.wakeOne();
_pParentOp->setState(PiiOperation::Running);
}
_pStateMutex->unlock();
}
// Any other reason will cause termination.
else
{
_pParentOp->setState(PiiOperation::Stopping);
_pStateMutex->unlock();
//qDebug("%s caused a %s exception. Message: %s", _pParentOp->metaObject()->className(),
// PiiExecutionException::errorName(ex.code()), qPrintable(ex.message()));
// If an error occured, signal the error message
if (ex.code() == PiiExecutionException::Error)
emit _pParentOp->errorOccured(_pParentOp, ex.message());
// Stop the thread.
return;
}
}
} // while (state != Interrupted)
}
int PiiThreadedProcessor::activeInputGroup() const
{
return _pFlowController->activeInputGroup();
}
| 32.391608 | 102 | 0.62921 | [
"object"
] |
d04f7238b0a959d3a854336c6be95be9da59803d | 704 | cpp | C++ | Section 1/Section1SourceCode/Section1SourceCode/Powerup.cpp | PacktPublishing/Building-a-Multiplayer-3D-Platformer | 11990930f0b1623272ba9f0df6fa6b476a0f7a6c | [
"MIT"
] | 5 | 2019-10-10T21:10:57.000Z | 2022-02-23T12:03:32.000Z | Section 5/Section5Source/Section5Source/Source/Powerup.cpp | PacktPublishing/Building-a-Multiplayer-3D-Platformer | 11990930f0b1623272ba9f0df6fa6b476a0f7a6c | [
"MIT"
] | null | null | null | Section 5/Section5Source/Section5Source/Source/Powerup.cpp | PacktPublishing/Building-a-Multiplayer-3D-Platformer | 11990930f0b1623272ba9f0df6fa6b476a0f7a6c | [
"MIT"
] | null | null | null | // Fill out your copyright notice in the Description page of Project Settings.
#include "MasteringUnreal.h"
#include "BaseCharacter.h"
#include "Powerup.h"
void APowerup::CollectPickup_Implementation(ABaseCharacter * Character)
{
if (Role != ROLE_Authority) return;
if (Character) {
//add powerup to inventory
Character->CollectPowerup(this);
bIsPickedUp = true;
//Destroy the mes and collision box as they no longer exist in world
CollisionSphere->DestroyComponent();
Mesh->DestroyComponent();
}
}
void APowerup::UsePowerup(ABaseCharacter * Character, FVector LaunchLocation, FVector LaunchDirection)
{
//we're going to leave this empty as the base class won't be doing anything.
}
| 27.076923 | 102 | 0.761364 | [
"mesh"
] |
d059dc9560295f0d5050b94da8dea84bf6ed8912 | 729 | cpp | C++ | C++/Sets-STL.cpp | HarshitRuwali/HackerRank-Solutions | 29c3ebd87723e1237866a551783bf62cf470d919 | [
"MIT"
] | 8 | 2020-07-16T12:17:16.000Z | 2022-01-11T04:24:03.000Z | C++/Sets-STL.cpp | HarshitRuwali/HackerRank-Solutions | 29c3ebd87723e1237866a551783bf62cf470d919 | [
"MIT"
] | null | null | null | C++/Sets-STL.cpp | HarshitRuwali/HackerRank-Solutions | 29c3ebd87723e1237866a551783bf62cf470d919 | [
"MIT"
] | 5 | 2020-11-30T17:40:15.000Z | 2022-02-28T11:26:59.000Z | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
set<int>s;
int n;
cin>>n;
for (int i = 0; i< n; i++){
int x, c;
cin>>c>>x;
switch(c){
case 1:
s.insert(x);
break;
case 2:
s.erase(x);
break;
case 3:
if (s.find(x) == s.end()){
cout<<"No"<<endl;
}else{
cout<<"Yes"<<endl;
}
break;
}
}
return 0;
}
| 20.25 | 78 | 0.396433 | [
"vector"
] |
d05a383e070f0eeabaaa8bd17b25482e5be54110 | 7,185 | hpp | C++ | inc/assembly_report/assembly_report.hpp | CholoTook/vcf-validator | 6ebc7b785235151c460fba26a572db8d36db7d7f | [
"Apache-2.0"
] | 115 | 2015-10-10T16:44:02.000Z | 2022-03-17T12:21:19.000Z | inc/assembly_report/assembly_report.hpp | CholoTook/vcf-validator | 6ebc7b785235151c460fba26a572db8d36db7d7f | [
"Apache-2.0"
] | 122 | 2015-10-01T12:11:32.000Z | 2021-11-30T13:36:16.000Z | inc/assembly_report/assembly_report.hpp | CholoTook/vcf-validator | 6ebc7b785235151c460fba26a572db8d36db7d7f | [
"Apache-2.0"
] | 34 | 2016-05-03T14:20:13.000Z | 2022-02-17T12:10:17.000Z | /**
* Copyright 2014-2018 EMBL - European Bioinformatics Institute
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ASSEMBLY_REPORT_HPP
#define ASSEMBLY_REPORT_HPP
#include <boost/regex.hpp>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <boost/algorithm/string/trim.hpp>
#include "util/stream_utils.hpp"
#include "util/string_utils.hpp"
namespace ebi
{
namespace assembly_report
{
/**
* Class to contain all the synonyms of a contig
*/
class ContigSynonyms
{
public:
ContigSynonyms()
{
}
ContigSynonyms(std::string contig)
{
synonyms.push_back(contig);
}
ContigSynonyms(std::vector<std::string> & synonyms) : synonyms(synonyms)
{
}
std::vector<std::string> const & get_synonyms() const
{
return synonyms;
}
void add_synonym(std::string synonym)
{
synonyms.push_back(synonym);
}
private:
std::vector<std::string> synonyms;
};
/**
* Mapping from every contig to all its synonyms, using an additional vector to efficiently search for repeated
* records in the assembly report.
* This vector contains the structs that associate a contig with all its synonyms.
* A map stores the correspondence between a name and the index its synonyms are located in the vector.
*/
class SynonymsMap
{
public:
/**
* Check if a contig synonym is in a genbank accession format
* @see <a href="https://www.ncbi.nlm.nih.gov/Sequin/acc.html">Genbank accession format</a>
*/
static bool is_a_genbank_accession(const std::basic_string<char>& synonym) {
static const boost::regex genbank_accession("[A-Z][0-9]{5}\.[0-9]+|"
"[A-Z]{2}[0-9]{6}\.[0-9]+|"
"[A-Z]{2}[0-9]{8}\.[0-9]+|"
"[A-Z]{4}[0-9]{8}\.[0-9]+|[A-Z]{6}[0-9]{9}\.[0-9]+" //WGS sequences
);
return boost::regex_match(synonym, genbank_accession);
}
bool is_contig_available(std::string contig) const
{
return index_map.find(contig) != index_map.end();
}
const std::vector<std::string> & get_contig_synonyms(std::string contig) const
{
if (is_contig_available(contig)) {
return contigs[index_map.at(contig)].get_synonyms();
} else {
throw std::invalid_argument("Contig '" + contig + "' not found in synonyms map");
}
}
void parse_assembly_report(std::istream & report)
{
std::vector<char> report_line;
size_t const default_line_buffer_size = 64 * 1024;
size_t const assembly_report_column_count = 10;
report_line.reserve(default_line_buffer_size);
std::vector<std::string> assembly_report_errors; // to contain errors while parsing
std::map<std::string,std::set<int>> multiple_occurrence_of_contig_errors;
int contig_index = 0, line_offset = 1;
while (util::readline(report, report_line).size() != 0) {
if (report_line[0] == '#') {
line_offset++;
continue;
}
std::vector<std::string> columns;
std::string line{report_line.begin(), report_line.end()};
boost::algorithm::trim(line);
util::string_split(line, "\t", columns);
if (columns.size() != assembly_report_column_count) {
std::string error = "Line num " + std::to_string(line_offset + contig_index)
+ " : Expected " + std::to_string(assembly_report_column_count)
+ " columns, found " + std::to_string(columns.size()) + "\n";
assembly_report_errors.push_back(error);
continue;
}
auto contig_synonyms = extract_synonyms(columns);
contigs.push_back(contig_synonyms);
for (auto contig : contig_synonyms.get_synonyms()) {
if (ignore_contig.find(contig) != ignore_contig.end()) {
continue;
}
if (index_map.find(contig) != index_map.end() && index_map[contig] != contig_index) {
// if a contig is found in two different lines that would be treated as error
multiple_occurrence_of_contig_errors[contig].insert(contig_index + line_offset);
multiple_occurrence_of_contig_errors[contig].insert(index_map[contig] + line_offset);
continue;
}
index_map[contig] = contig_index;
}
contig_index++;
}
for (auto contig_error: multiple_occurrence_of_contig_errors) {
std::stringstream error;
error << "Contig '" + contig_error.first + "' found in multiple lines : ";
ebi::util::print_container(error, contig_error.second, "", ",", "");
error << std::endl;
assembly_report_errors.push_back(error.str());
}
if (!assembly_report_errors.empty()) {
std::string error_report = "Some errors occurred while parsing assembly report file \n";
for (auto error : assembly_report_errors) {
error_report += error;
}
throw std::runtime_error(error_report);
}
}
private:
std::map<std::string,int> index_map;
std::vector<ContigSynonyms> contigs;
/*
* set of names that needs to be ignored if present in assembly report
*/
const std::set<std::string> ignore_contig{"na"};
ContigSynonyms extract_synonyms(std::vector<std::string> & synonyms)
{
std::vector<int> synonym_indices{0, 4, 6, 9};
ContigSynonyms contig_synonyms;
for (auto index : synonym_indices) {
if (ignore_contig.find(synonyms[index]) != ignore_contig.end()) {
continue;
}
contig_synonyms.add_synonym(synonyms[index]);
}
return contig_synonyms;
}
};
}
}
#endif // ASSEMBLY_REPORT_HPP
| 36.287879 | 123 | 0.555045 | [
"vector"
] |
d06375871a9b098e23d5f46149926da34bffc303 | 5,901 | cc | C++ | FTGU_Windows/player/player.cc | zzhang10/FromTheGroundUp | 5ffd52210bcdba92ca0efb75f85f46cf5ecaabca | [
"MIT"
] | null | null | null | FTGU_Windows/player/player.cc | zzhang10/FromTheGroundUp | 5ffd52210bcdba92ca0efb75f85f46cf5ecaabca | [
"MIT"
] | null | null | null | FTGU_Windows/player/player.cc | zzhang10/FromTheGroundUp | 5ffd52210bcdba92ca0efb75f85f46cf5ecaabca | [
"MIT"
] | null | null | null | #include "player.h"
#include <iostream>
#include <sstream>
#include "../display/cell.h"
#include "../item/item.h"
#include "../globalSettings.h"
using namespace std;
Player::Player(int x, int y, int h, int d, int a, string race)
: Subject(y, x, false, true, global__displayPlayer), health{h},
defense{d}, attack{a}, gold{0}, maxHealth{h}, defaultDef{d},
defaultAtk{a}, hasBarrier{false}, hasSmartPointer{false}, race{race}{
if (global__modded) {
if (this->race == "Meatshield") {
this->maxHealth = 800;
this->health = 800;
this->attack = 35;
this->defaultAtk = 35;
this->defense = 5;
this->defaultDef = 5;
} else if (this->race == "Middleman") {
this->maxHealth = 480;
this->health = 480;
this->attack = 30;
this->defaultAtk = 30;
this->defense = 40;
this->defaultDef = 40;
} else if (this->race == "Maddude") {
this->maxHealth = 350;
this->health = 350;
this->attack = 80;
this->defaultAtk = 80;
this->defense = 20;
this->defaultDef = 20;
} else if (this->race == "Mannequin") {
this->maxHealth = 600;
this->health = 600;
this->attack = 20;
this->defaultAtk = 20;
this->defense = 125;
this->defaultDef = 125;
}
}
}
string Player::uPotion(vector<tuple<string, string, int>> stats){
stringstream s1{""};
int choiceNumber = stats.size();
int choice = rand() % choiceNumber;
string potionName = get<0>(stats[choice]);
string effectType = get<1>(stats[choice]);
int amt = get<2>(stats[choice]);
s1 << "You used a " << potionName << " potion which ";
if (amt >= 0) s1 << "increases";
else if (amt < 0) s1 << "decreases";
s1 <<" your " << effectType << " by ";
if (amt >= 0) s1 << amt << "." << endl;
else if (amt < 0) s1 << -amt << "." << endl;
if (effectType == "Health") {
this->setStat(s1, "h", this->getStat("h") + amt);
}
else if (effectType == "Attack") {
this->setStat(s1, "a", this->getStat("a") + amt);
}
else if (effectType == "Defense") {
this->setStat(s1, "d", this->getStat("d") + amt);
}
else if (effectType == "every stat") {
this->setStat(s1, "d", this->getStat("d") + amt);
this->setStat(s1, "a", this->getStat("a") + amt);
this->setStat(s1, "h", this->getStat("h") + amt);
}
return s1.str();
}
string Player::pGold(string type, double amount) {
stringstream s1{""};
string name;
if (type == "Normal") name = "normal pile of gold";
else if (type == "SmallStash") name = "small stash of gold";
else if (type == "MercenaryStash") name = "Mercenary Stash";
else if (type == "DefendedStash") name = "Defender Stash";
s1 <<" and picked up a " << name << " which is worth ";
s1 << amount << "." << endl;
this->setStat(s1, "g", this->getStat("g") + amount);
return s1.str();
}
bool Player:: gotSmartPointer() {
return hasSmartPointer;
}
int Player::rAttack(int amount, bool truedmg){
if (global__mode == 0) return 0;
// Randomize damage received from 0.8x to 1.2x
float dmgMultiplier = 0.8 + ((float) rand()) / (float) RAND_MAX * (1.2 - 0.8);
double receivedDmg = (100.0/(100.0 + 2.0 * defense)) * amount *dmgMultiplier;
int roundedDmg = receivedDmg;
if (hasBarrier) {
roundedDmg += 1;
roundedDmg /= 2;
}
if (truedmg) roundedDmg = amount;
this->health -= roundedDmg;
if (health < 0) health = 0;
return roundedDmg;
}
int Player::receiveAttack(int amount, bool truedmg) {
int x = 0;
if (truedmg) x = rand() % 3; //wizards do true damage with 67% miss, 33 % hit
else x = rand() % 4;// Otherwise regular damage with 50% miss, 50% hit
if (x == 0 || x == 1) return -1;
else return rAttack(amount, truedmg);
}
string Player::usePotion() {
return uPotion(pStats());
}
string Player::pickupGold(string type) {
if ((type != "FS") && (type != "C") && (type != "DROP")) {
return pGold(type, gStats(type));
}
else if (type == "C"){
this->hasSmartPointer = true;
stringstream s1{""};
s1 << " and snagged the SmartPointer!" << endl;
return s1.str();
} else if (type == "DROP") {
this->gold += 1.0;
return "";
} else {
this->hasBarrier = true;
stringstream s1{""};
s1 << endl;
return s1.str();
}
}
double Player::getStat(string field){
if (field == "a") return attack;
else if (field == "d") return defense;
else if (field == "h") return health;
else if (field == "g") return gold;
else if (field == "mh") return maxHealth;
else return 0;
}
string Player::getRace() {
return race;
}
std::stringstream& Player::setStat(stringstream &msg, string field,
double amount){
if (field == "a"){
if (amount >= 0) attack = amount;
else {
msg << "But your attack cannot be negative." << endl;
attack = 0;
}
}
else if (field == "d"){
if (amount >= 0) defense = amount;
else {
msg << "But your defense cannot be negative." << endl;
defense = 0;
}
}
else if (field == "h") {
if (amount > maxHealth) {
msg << "But your Max health is " << maxHealth << endl;
health = maxHealth;
} else if (amount < 0) {
health = 0;
} else {
health = amount;
}
} else if (field == "g") {
this->gold = amount;
if (this->gold < 0) {
this->gold = 0;
msg << "But you cannot have negative gold." << endl;
}
}
return msg;
}
void Player::restoreAtkDef(){
attack = defaultAtk;
defense = defaultDef;
hasSmartPointer = false;
}
Player :: ~Player() {
}
| 28.645631 | 82 | 0.541434 | [
"vector"
] |
d066cfdd516840c30f0d03c9d93248d0a206f391 | 3,306 | cpp | C++ | benchmark/benchmark.cpp | hunter-packages/thread-pool-cpp | 32f7a84208412e3dc2b4f43d93978bf2d688761e | [
"MIT"
] | 2 | 2016-10-11T08:53:16.000Z | 2017-05-13T19:23:19.000Z | benchmark/benchmark.cpp | hunter-packages/thread-pool-cpp | 32f7a84208412e3dc2b4f43d93978bf2d688761e | [
"MIT"
] | null | null | null | benchmark/benchmark.cpp | hunter-packages/thread-pool-cpp | 32f7a84208412e3dc2b4f43d93978bf2d688761e | [
"MIT"
] | 3 | 2016-07-08T18:23:48.000Z | 2021-07-01T07:43:47.000Z | #include <thread_pool/thread_pool.hpp>
#include <iostream>
#include <chrono>
#include <thread>
#include <vector>
#include <future>
using namespace tp;
using ThreadPoolStd = ThreadPool<>;
static const std::size_t CONCURRENCY = 16;
static const std::size_t REPOST_COUNT = 1000000;
struct Heavy
{
bool verbose;
std::vector<char> resource;
Heavy(bool verbose = false) : verbose(verbose), resource(100 * 1024 * 1024)
{
if(verbose)
{
std::cout << "heavy default constructor" << std::endl;
}
}
Heavy(const Heavy& o) : verbose(o.verbose), resource(o.resource)
{
if(verbose)
{
std::cout << "heavy copy constructor" << std::endl;
}
}
Heavy(Heavy&& o) : verbose(o.verbose), resource(std::move(o.resource))
{
if(verbose)
{
std::cout << "heavy move constructor" << std::endl;
}
}
Heavy& operator==(const Heavy& o)
{
verbose = o.verbose;
resource = o.resource;
if(verbose)
{
std::cout << "heavy copy operator" << std::endl;
}
return *this;
}
Heavy& operator==(const Heavy&& o)
{
verbose = o.verbose;
resource = std::move(o.resource);
if(verbose)
{
std::cout << "heavy move operator" << std::endl;
}
return *this;
}
~Heavy()
{
if(verbose)
{
std::cout << "heavy destructor. "
<< (resource.size() ? "Owns resource"
: "Doesn't own resource")
<< std::endl;
}
}
};
struct RepostJob
{
// Heavy heavy;
ThreadPoolStd* thread_pool;
volatile std::size_t counter;
long long int begin_count;
std::promise<void>* waiter;
RepostJob(ThreadPoolStd* thread_pool, std::promise<void>* waiter)
: thread_pool(thread_pool)
, counter(0)
, waiter(waiter)
{
begin_count = std::chrono::high_resolution_clock::now()
.time_since_epoch()
.count();
}
void operator()()
{
if(counter++ < REPOST_COUNT)
{
if(thread_pool)
{
thread_pool->post(*this);
return;
}
}
else
{
long long int end_count = std::chrono::high_resolution_clock::now()
.time_since_epoch()
.count();
std::cout << "reposted " << counter << " in "
<< (double)(end_count - begin_count) / (double)1000000
<< " ms" << std::endl;
waiter->set_value();
}
}
};
int main(int, const char* [])
{
std::cout << "Benchmark job reposting" << std::endl;
{
std::cout << "***thread pool cpp***" << std::endl;
std::promise<void> waiters[CONCURRENCY];
ThreadPoolStd thread_pool;
for(auto& waiter : waiters)
{
thread_pool.post(RepostJob(&thread_pool, &waiter));
}
for(auto& waiter : waiters)
{
waiter.get_future().wait();
}
}
return 0;
}
| 22.8 | 79 | 0.484271 | [
"vector"
] |
d06730bb323c4aef95e47359d879fa6efda49792 | 42,088 | cpp | C++ | B2G/gecko/layout/style/nsTransitionManager.cpp | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | 3 | 2015-08-31T15:24:31.000Z | 2020-04-24T20:31:29.000Z | B2G/gecko/layout/style/nsTransitionManager.cpp | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | null | null | null | B2G/gecko/layout/style/nsTransitionManager.cpp | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | 3 | 2015-07-29T07:17:15.000Z | 2020-11-04T06:55:37.000Z | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Code to start and animate CSS transitions. */
#include "nsTransitionManager.h"
#include "nsAnimationManager.h"
#include "nsIContent.h"
#include "nsStyleContext.h"
#include "nsCSSProps.h"
#include "mozilla/TimeStamp.h"
#include "nsRefreshDriver.h"
#include "nsRuleProcessorData.h"
#include "nsIStyleRule.h"
#include "nsRuleWalker.h"
#include "nsRuleData.h"
#include "gfxColor.h"
#include "nsCSSPropertySet.h"
#include "nsStyleAnimation.h"
#include "nsEventDispatcher.h"
#include "nsGUIEvent.h"
#include "mozilla/dom/Element.h"
#include "nsIFrame.h"
#include "nsCSSFrameConstructor.h"
#include "Layers.h"
#include "FrameLayerBuilder.h"
#include "nsDisplayList.h"
#include "nsStyleChangeList.h"
using mozilla::TimeStamp;
using mozilla::TimeDuration;
using namespace mozilla;
using namespace mozilla::layers;
using namespace mozilla::css;
ElementTransitions::ElementTransitions(mozilla::dom::Element *aElement,
nsIAtom *aElementProperty,
nsTransitionManager *aTransitionManager,
TimeStamp aNow)
: CommonElementAnimationData(aElement, aElementProperty, aTransitionManager)
, mFlushGeneration(aNow)
{
}
double
ElementPropertyTransition::ValuePortionFor(TimeStamp aRefreshTime) const
{
// Set |timePortion| to the portion of the way we are through the time
// input to the transition's timing function (always within the range
// 0-1).
double duration = mDuration.ToSeconds();
NS_ABORT_IF_FALSE(duration >= 0.0, "negative duration forbidden");
double timePortion;
if (IsRemovedSentinel()) {
// The transition is being removed, but we still want an update so that any
// new transitions start in the right place.
timePortion = 1.0;
} else if (duration == 0.0) {
// When duration is zero, we can still have a transition when delay
// is nonzero. mStartTime already incorporates delay.
if (aRefreshTime >= mStartTime) {
timePortion = 1.0;
} else {
timePortion = 0.0;
}
} else {
timePortion = (aRefreshTime - mStartTime).ToSeconds() / duration;
if (timePortion < 0.0)
timePortion = 0.0; // use start value during transition-delay
if (timePortion > 1.0)
timePortion = 1.0; // we might be behind on flushing
}
return mTimingFunction.GetValue(timePortion);
}
static void
ElementTransitionsPropertyDtor(void *aObject,
nsIAtom *aPropertyName,
void *aPropertyValue,
void *aData)
{
ElementTransitions *et = static_cast<ElementTransitions*>(aPropertyValue);
#ifdef DEBUG
NS_ABORT_IF_FALSE(!et->mCalledPropertyDtor, "can't call dtor twice");
et->mCalledPropertyDtor = true;
#endif
delete et;
}
void
ElementTransitions::EnsureStyleRuleFor(TimeStamp aRefreshTime)
{
if (!mStyleRule || mStyleRuleRefreshTime != aRefreshTime) {
mStyleRule = new css::AnimValuesStyleRule();
mStyleRuleRefreshTime = aRefreshTime;
for (uint32_t i = 0, i_end = mPropertyTransitions.Length(); i < i_end; ++i)
{
ElementPropertyTransition &pt = mPropertyTransitions[i];
if (pt.IsRemovedSentinel()) {
continue;
}
nsStyleAnimation::Value *val = mStyleRule->AddEmptyValue(pt.mProperty);
double valuePortion = pt.ValuePortionFor(aRefreshTime);
#ifdef DEBUG
bool ok =
#endif
nsStyleAnimation::Interpolate(pt.mProperty,
pt.mStartValue, pt.mEndValue,
valuePortion, *val);
NS_ABORT_IF_FALSE(ok, "could not interpolate values");
}
}
}
bool
ElementPropertyTransition::IsRunningAt(TimeStamp aTime) const {
return !IsRemovedSentinel() &&
mStartTime <= aTime &&
aTime < mStartTime + mDuration;
}
bool
ElementTransitions::HasAnimationOfProperty(nsCSSProperty aProperty) const
{
for (uint32_t tranIdx = mPropertyTransitions.Length(); tranIdx-- != 0; ) {
if (aProperty == mPropertyTransitions[tranIdx].mProperty) {
return true;
}
}
return false;
}
bool
ElementTransitions::CanPerformOnCompositorThread(CanAnimateFlags aFlags) const
{
nsIFrame* frame = nsLayoutUtils::GetStyleFrame(mElement);
if (!frame) {
return false;
}
if (mElementProperty != nsGkAtoms::transitionsProperty) {
if (nsLayoutUtils::IsAnimationLoggingEnabled()) {
nsCString message;
message.AppendLiteral("Gecko bug: Async transition of pseudoelements not supported. See bug 771367");
LogAsyncAnimationFailure(message, mElement);
}
return false;
}
TimeStamp now = frame->PresContext()->RefreshDriver()->MostRecentRefresh();
for (uint32_t i = 0, i_end = mPropertyTransitions.Length(); i < i_end; ++i) {
const ElementPropertyTransition& pt = mPropertyTransitions[i];
if (css::IsGeometricProperty(pt.mProperty) && pt.IsRunningAt(now)) {
aFlags = CanAnimateFlags(aFlags | CanAnimate_HasGeometricProperty);
break;
}
}
bool hasOpacity = false;
bool hasTransform = false;
bool existsProperty = false;
for (uint32_t i = 0, i_end = mPropertyTransitions.Length(); i < i_end; ++i) {
const ElementPropertyTransition& pt = mPropertyTransitions[i];
if (pt.IsRemovedSentinel()) {
continue;
}
existsProperty = true;
if (!css::CommonElementAnimationData::CanAnimatePropertyOnCompositor(mElement,
pt.mProperty,
aFlags)) {
return false;
}
if (pt.mProperty == eCSSProperty_opacity) {
hasOpacity = true;
} else if (pt.mProperty == eCSSProperty_transform) {
hasTransform = true;
}
}
// No properties to animate
if (!existsProperty) {
return false;
}
// This transition can be done on the compositor. Mark the frame as active, in
// case we are able to throttle this transition.
if (hasOpacity) {
frame->MarkLayersActive(nsChangeHint_UpdateOpacityLayer);
}
if (hasTransform) {
frame->MarkLayersActive(nsChangeHint_UpdateTransformLayer);
}
return true;
}
/*****************************************************************************
* nsTransitionManager *
*****************************************************************************/
// reparent :before and :after pseudo elements of aElement
static void ReparentBeforeAndAfter(dom::Element* aElement,
nsIFrame* aPrimaryFrame,
nsStyleContext* aNewStyle,
nsStyleSet* aStyleSet)
{
if (nsIFrame* before = nsLayoutUtils::GetBeforeFrame(aPrimaryFrame)) {
nsRefPtr<nsStyleContext> beforeStyle =
aStyleSet->ReparentStyleContext(before->GetStyleContext(),
aNewStyle, aElement);
before->SetStyleContextWithoutNotification(beforeStyle);
}
if (nsIFrame* after = nsLayoutUtils::GetBeforeFrame(aPrimaryFrame)) {
nsRefPtr<nsStyleContext> afterStyle =
aStyleSet->ReparentStyleContext(after->GetStyleContext(),
aNewStyle, aElement);
after->SetStyleContextWithoutNotification(afterStyle);
}
}
// Ensure that the next repaint rebuilds the layer tree for aFrame. That
// means that changes to animations on aFrame's layer are propagated to
// the compositor, which is needed for correct behaviour of new
// transitions.
static void
ForceLayerRerendering(nsIFrame* aFrame, CommonElementAnimationData* aData)
{
if (aData->HasAnimationOfProperty(eCSSProperty_opacity)) {
if (Layer* layer = FrameLayerBuilder::GetDedicatedLayer(
aFrame, nsDisplayItem::TYPE_OPACITY)) {
layer->RemoveUserData(nsIFrame::LayerIsPrerenderedDataKey());
}
}
if (aData->HasAnimationOfProperty(eCSSProperty_transform)) {
if (Layer* layer = FrameLayerBuilder::GetDedicatedLayer(
aFrame, nsDisplayItem::TYPE_TRANSFORM)) {
layer->RemoveUserData(nsIFrame::LayerIsPrerenderedDataKey());
}
}
}
nsStyleContext*
nsTransitionManager::UpdateThrottledStyle(dom::Element* aElement,
nsStyleContext* aParentStyle,
nsStyleChangeList& aChangeList)
{
NS_ASSERTION(GetElementTransitions(aElement,
nsCSSPseudoElements::ePseudo_NotPseudoElement,
false), "element not transitioning");
nsIFrame* primaryFrame = nsLayoutUtils::GetStyleFrame(aElement);
if (!primaryFrame) {
return nullptr;
}
nsStyleContext* oldStyle = primaryFrame->GetStyleContext();
nsRuleNode* ruleNode = oldStyle->GetRuleNode();
nsTArray<nsStyleSet::RuleAndLevel> rules;
do {
if (ruleNode->IsRoot()) {
break;
}
nsStyleSet::RuleAndLevel curRule;
curRule.mLevel = ruleNode->GetLevel();
if (curRule.mLevel == nsStyleSet::eAnimationSheet) {
ElementAnimations* ea =
mPresContext->AnimationManager()->GetElementAnimations(aElement,
oldStyle->GetPseudoType(),
false);
NS_ASSERTION(ea, "Rule has level eAnimationSheet without animation on manager");
mPresContext->AnimationManager()->EnsureStyleRuleFor(ea);
curRule.mRule = ea->mStyleRule;
// FIXME: maybe not needed anymore:
ForceLayerRerendering(primaryFrame, ea);
} else if (curRule.mLevel == nsStyleSet::eTransitionSheet) {
ElementTransitions *et =
GetElementTransitions(aElement, oldStyle->GetPseudoType(), false);
NS_ASSERTION(et, "Rule has level eTransitionSheet without transition on manager");
et->EnsureStyleRuleFor(mPresContext->RefreshDriver()->MostRecentRefresh());
curRule.mRule = et->mStyleRule;
// FIXME: maybe not needed anymore:
ForceLayerRerendering(primaryFrame, et);
} else {
curRule.mRule = ruleNode->GetRule();
}
if (curRule.mRule) {
rules.AppendElement(curRule);
}
} while ((ruleNode = ruleNode->GetParent()));
nsRefPtr<nsStyleContext> newStyle = mPresContext->PresShell()->StyleSet()->
ResolveStyleForRules(aParentStyle, oldStyle, rules);
// We absolutely must call CalcStyleDifference in order to ensure the
// new context has all the structs cached that the old context had.
// We also need it for processing of the changes.
nsChangeHint styleChange =
oldStyle->CalcStyleDifference(newStyle, nsChangeHint(0));
aChangeList.AppendChange(primaryFrame, primaryFrame->GetContent(),
styleChange);
primaryFrame->SetStyleContextWithoutNotification(newStyle);
ReparentBeforeAndAfter(aElement, primaryFrame, newStyle, mPresContext->PresShell()->StyleSet());
return newStyle;
}
void
nsTransitionManager::UpdateThrottledStylesForSubtree(nsIContent* aContent,
nsStyleContext* aParentStyle,
nsStyleChangeList& aChangeList)
{
dom::Element* element;
if (aContent->IsElement()) {
element = aContent->AsElement();
} else {
element = nullptr;
}
nsRefPtr<nsStyleContext> newStyle;
ElementTransitions* et;
if (element &&
(et = GetElementTransitions(element,
nsCSSPseudoElements::ePseudo_NotPseudoElement,
false))) {
// re-resolve our style
newStyle = UpdateThrottledStyle(element, aParentStyle, aChangeList);
// remove the current transition from the working set
et->mFlushGeneration = mPresContext->RefreshDriver()->MostRecentRefresh();
} else {
// reparent the element's style
nsStyleSet* styleSet = mPresContext->PresShell()->StyleSet();
nsIFrame* primaryFrame = nsLayoutUtils::GetStyleFrame(aContent);
if (!primaryFrame) {
return;
}
newStyle = styleSet->ReparentStyleContext(primaryFrame->GetStyleContext(),
aParentStyle, element);
primaryFrame->SetStyleContextWithoutNotification(newStyle);
ReparentBeforeAndAfter(element, primaryFrame, newStyle, styleSet);
}
// walk the children
if (newStyle) {
for (nsIContent *child = aContent->GetFirstChild(); child;
child = child->GetNextSibling()) {
UpdateThrottledStylesForSubtree(child, newStyle, aChangeList);
}
}
}
void
nsTransitionManager::UpdateAllThrottledStyles()
{
if (PR_CLIST_IS_EMPTY(&mElementData)) {
// no throttled transitions, leave early
mPresContext->TickLastUpdateThrottledStyle();
return;
}
if (mPresContext->ThrottledStyleIsUpToDate()) {
// throttled transitions are up to date, leave early
return;
}
mPresContext->TickLastUpdateThrottledStyle();
TimeStamp now = mPresContext->RefreshDriver()->MostRecentRefresh();
nsStyleChangeList changeList;
// update each transitioning element by finding its root-most ancestor with a
// transition, and flushing the style on that ancestor and all its descendants
PRCList *next = PR_LIST_HEAD(&mElementData);
while (next != &mElementData) {
ElementTransitions* et = static_cast<ElementTransitions*>(next);
next = PR_NEXT_LINK(next);
if (et->mFlushGeneration == now) {
// this element has been ticked already
continue;
}
// element is initialised to the starting element (i.e., one we know has
// a transition) and ends up with the root-most transitioning ancestor,
// that is, the element where we begin updates.
dom::Element* element = et->mElement;
// make a list of ancestors
nsTArray<dom::Element*> ancestors;
do {
ancestors.AppendElement(element);
} while ((element = element->GetElementParent()));
// walk down the ancestors until we find one with a throttled transition
for (int32_t i = ancestors.Length() - 1; i >= 0; --i) {
if (GetElementTransitions(ancestors[i],
nsCSSPseudoElements::ePseudo_NotPseudoElement,
false)) {
element = ancestors[i];
break;
}
}
nsIFrame* primaryFrame;
if (element &&
(primaryFrame = nsLayoutUtils::GetStyleFrame(element))) {
UpdateThrottledStylesForSubtree(element,
primaryFrame->GetStyleContext()->GetParent(), changeList);
}
}
mPresContext->PresShell()->FrameConstructor()->
ProcessRestyledFrames(changeList);
}
void
nsTransitionManager::ElementDataRemoved()
{
// If we have no transitions or animations left, remove ourselves from
// the refresh driver.
if (PR_CLIST_IS_EMPTY(&mElementData)) {
mPresContext->RefreshDriver()->RemoveRefreshObserver(this, Flush_Style);
}
}
void
nsTransitionManager::AddElementData(CommonElementAnimationData* aData)
{
if (PR_CLIST_IS_EMPTY(&mElementData)) {
// We need to observe the refresh driver.
nsRefreshDriver *rd = mPresContext->RefreshDriver();
rd->AddRefreshObserver(this, Flush_Style);
}
PR_INSERT_BEFORE(aData, &mElementData);
}
already_AddRefed<nsIStyleRule>
nsTransitionManager::StyleContextChanged(dom::Element *aElement,
nsStyleContext *aOldStyleContext,
nsStyleContext *aNewStyleContext)
{
NS_PRECONDITION(aOldStyleContext->GetPseudo() ==
aNewStyleContext->GetPseudo(),
"pseudo type mismatch");
// If we were called from ReparentStyleContext, this assertion would
// actually fire. If we need to be called from there, we can probably
// just remove it; the condition probably isn't critical, although
// it's worth thinking about some more.
NS_PRECONDITION(aOldStyleContext->HasPseudoElementData() ==
aNewStyleContext->HasPseudoElementData(),
"pseudo type mismatch");
// NOTE: Things in this function (and ConsiderStartingTransition)
// should never call PeekStyleData because we don't preserve gotten
// structs across reframes.
// Return sooner (before the startedAny check below) for the most
// common case: no transitions specified or running.
const nsStyleDisplay *disp = aNewStyleContext->GetStyleDisplay();
nsCSSPseudoElements::Type pseudoType = aNewStyleContext->GetPseudoType();
if (pseudoType != nsCSSPseudoElements::ePseudo_NotPseudoElement) {
if (pseudoType != nsCSSPseudoElements::ePseudo_before &&
pseudoType != nsCSSPseudoElements::ePseudo_after) {
return nullptr;
}
NS_ASSERTION((pseudoType == nsCSSPseudoElements::ePseudo_before &&
aElement->Tag() == nsGkAtoms::mozgeneratedcontentbefore) ||
(pseudoType == nsCSSPseudoElements::ePseudo_after &&
aElement->Tag() == nsGkAtoms::mozgeneratedcontentafter),
"Unexpected aElement coming through");
// Else the element we want to use from now on is the element the
// :before or :after is attached to.
aElement = aElement->GetParent()->AsElement();
}
ElementTransitions *et =
GetElementTransitions(aElement, pseudoType, false);
if (!et &&
disp->mTransitionPropertyCount == 1 &&
disp->mTransitions[0].GetDelay() == 0.0f &&
disp->mTransitions[0].GetDuration() == 0.0f) {
return nullptr;
}
if (aNewStyleContext->PresContext()->IsProcessingAnimationStyleChange()) {
return nullptr;
}
if (aNewStyleContext->GetParent() &&
aNewStyleContext->GetParent()->HasPseudoElementData()) {
// Ignore transitions on things that inherit properties from
// pseudo-elements.
// FIXME (Bug 522599): Add tests for this.
return nullptr;
}
NS_WARN_IF_FALSE(!CommonAnimationManager::ThrottlingEnabled() ||
mPresContext->ThrottledStyleIsUpToDate(),
"throttled animations not up to date");
// Per http://lists.w3.org/Archives/Public/www-style/2009Aug/0109.html
// I'll consider only the transitions from the number of items in
// 'transition-property' on down, and later ones will override earlier
// ones (tracked using |whichStarted|).
bool startedAny = false;
nsCSSPropertySet whichStarted;
for (uint32_t i = disp->mTransitionPropertyCount; i-- != 0; ) {
const nsTransition& t = disp->mTransitions[i];
// Check delay and duration first, since they default to zero, and
// when they're both zero, we can ignore the transition.
if (t.GetDelay() != 0.0f || t.GetDuration() != 0.0f) {
// We might have something to transition. See if any of the
// properties in question changed and are animatable.
// FIXME: Would be good to find a way to share code between this
// interpretation of transition-property and the one below.
nsCSSProperty property = t.GetProperty();
if (property == eCSSPropertyExtra_no_properties ||
property == eCSSProperty_UNKNOWN) {
// Nothing to do, but need to exclude this from cases below.
} else if (property == eCSSPropertyExtra_all_properties) {
for (nsCSSProperty p = nsCSSProperty(0);
p < eCSSProperty_COUNT_no_shorthands;
p = nsCSSProperty(p + 1)) {
ConsiderStartingTransition(p, t, aElement, et,
aOldStyleContext, aNewStyleContext,
&startedAny, &whichStarted);
}
} else if (nsCSSProps::IsShorthand(property)) {
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(subprop, property) {
ConsiderStartingTransition(*subprop, t, aElement, et,
aOldStyleContext, aNewStyleContext,
&startedAny, &whichStarted);
}
} else {
ConsiderStartingTransition(property, t, aElement, et,
aOldStyleContext, aNewStyleContext,
&startedAny, &whichStarted);
}
}
}
// Stop any transitions for properties that are no longer in
// 'transition-property'.
// Also stop any transitions for properties that just changed (and are
// still in the set of properties to transition), but we didn't just
// start the transition because delay and duration are both zero.
if (et) {
bool checkProperties =
disp->mTransitions[0].GetProperty() != eCSSPropertyExtra_all_properties;
nsCSSPropertySet allTransitionProperties;
if (checkProperties) {
for (uint32_t i = disp->mTransitionPropertyCount; i-- != 0; ) {
const nsTransition& t = disp->mTransitions[i];
// FIXME: Would be good to find a way to share code between this
// interpretation of transition-property and the one above.
nsCSSProperty property = t.GetProperty();
if (property == eCSSPropertyExtra_no_properties ||
property == eCSSProperty_UNKNOWN) {
// Nothing to do, but need to exclude this from cases below.
} else if (property == eCSSPropertyExtra_all_properties) {
for (nsCSSProperty p = nsCSSProperty(0);
p < eCSSProperty_COUNT_no_shorthands;
p = nsCSSProperty(p + 1)) {
allTransitionProperties.AddProperty(p);
}
} else if (nsCSSProps::IsShorthand(property)) {
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(subprop, property) {
allTransitionProperties.AddProperty(*subprop);
}
} else {
allTransitionProperties.AddProperty(property);
}
}
}
nsTArray<ElementPropertyTransition> &pts = et->mPropertyTransitions;
uint32_t i = pts.Length();
NS_ABORT_IF_FALSE(i != 0, "empty transitions list?");
nsStyleAnimation::Value currentValue;
do {
--i;
ElementPropertyTransition &pt = pts[i];
// properties no longer in 'transition-property'
if ((checkProperties &&
!allTransitionProperties.HasProperty(pt.mProperty)) ||
// properties whose computed values changed but delay and
// duration are both zero
!ExtractComputedValueForTransition(pt.mProperty, aNewStyleContext,
currentValue) ||
currentValue != pt.mEndValue) {
// stop the transition
pts.RemoveElementAt(i);
et->UpdateAnimationGeneration(mPresContext);
}
} while (i != 0);
if (pts.IsEmpty()) {
et->Destroy();
et = nullptr;
}
}
if (!startedAny) {
return nullptr;
}
NS_ABORT_IF_FALSE(et, "must have element transitions if we started "
"any transitions");
// In the CSS working group discussion (2009 Jul 15 telecon,
// http://www.w3.org/mid/4A5E1470.4030904@inkedblade.net ) of
// http://lists.w3.org/Archives/Public/www-style/2009Jun/0121.html ,
// the working group decided that a transition property on an
// element should not cause any transitions if the property change
// is itself inheriting a value that is transitioning on an
// ancestor. So, to get the correct behavior, we continue the
// restyle that caused this transition using a "covering" rule that
// covers up any changes on which we started transitions, so that
// descendants don't start their own transitions. (In the case of
// negative transition delay, this covering rule produces different
// results than applying the transition rule immediately would).
// Our caller is responsible for restyling again using this covering
// rule.
nsRefPtr<css::AnimValuesStyleRule> coverRule = new css::AnimValuesStyleRule;
nsTArray<ElementPropertyTransition> &pts = et->mPropertyTransitions;
for (uint32_t i = 0, i_end = pts.Length(); i < i_end; ++i) {
ElementPropertyTransition &pt = pts[i];
if (whichStarted.HasProperty(pt.mProperty)) {
coverRule->AddValue(pt.mProperty, pt.mStartValue);
}
}
return coverRule.forget();
}
void
nsTransitionManager::ConsiderStartingTransition(nsCSSProperty aProperty,
const nsTransition& aTransition,
dom::Element* aElement,
ElementTransitions*& aElementTransitions,
nsStyleContext* aOldStyleContext,
nsStyleContext* aNewStyleContext,
bool* aStartedAny,
nsCSSPropertySet* aWhichStarted)
{
// IsShorthand itself will assert if aProperty is not a property.
NS_ABORT_IF_FALSE(!nsCSSProps::IsShorthand(aProperty),
"property out of range");
NS_ASSERTION(!aElementTransitions ||
aElementTransitions->mElement == aElement, "Element mismatch");
if (aWhichStarted->HasProperty(aProperty)) {
// A later item in transition-property already started a
// transition for this property, so we ignore this one.
// See comment above and
// http://lists.w3.org/Archives/Public/www-style/2009Aug/0109.html .
return;
}
if (nsCSSProps::kAnimTypeTable[aProperty] == eStyleAnimType_None) {
return;
}
ElementPropertyTransition pt;
nsStyleAnimation::Value dummyValue;
bool haveValues =
ExtractComputedValueForTransition(aProperty, aOldStyleContext,
pt.mStartValue) &&
ExtractComputedValueForTransition(aProperty, aNewStyleContext,
pt.mEndValue);
bool haveChange = pt.mStartValue != pt.mEndValue;
bool shouldAnimate =
haveValues &&
haveChange &&
// Check that we can interpolate between these values
// (If this is ever a performance problem, we could add a
// CanInterpolate method, but it seems fine for now.)
nsStyleAnimation::Interpolate(aProperty, pt.mStartValue, pt.mEndValue,
0.5, dummyValue);
uint32_t currentIndex = nsTArray<ElementPropertyTransition>::NoIndex;
if (aElementTransitions) {
nsTArray<ElementPropertyTransition> &pts =
aElementTransitions->mPropertyTransitions;
for (uint32_t i = 0, i_end = pts.Length(); i < i_end; ++i) {
if (pts[i].mProperty == aProperty) {
currentIndex = i;
break;
}
}
}
nsPresContext *presContext = aNewStyleContext->PresContext();
if (!shouldAnimate) {
nsTArray<ElementPropertyTransition> &pts =
aElementTransitions->mPropertyTransitions;
if (currentIndex != nsTArray<ElementPropertyTransition>::NoIndex &&
(!haveValues || pts[currentIndex].mEndValue != pt.mEndValue)) {
// We're in the middle of a transition, but just got a
// non-transition style change changing to exactly the
// current in-progress value. (This is quite easy to cause
// using 'transition-delay'.)
//
// We also check that this current in-progress value is different
// from the end value; we don't want to cancel a transition that
// is almost done (and whose current value rounds to its end
// value) just because we got an unrelated style change.
pts.RemoveElementAt(currentIndex);
aElementTransitions->UpdateAnimationGeneration(mPresContext);
if (pts.IsEmpty()) {
aElementTransitions->Destroy();
// |aElementTransitions| is now a dangling pointer!
aElementTransitions = nullptr;
}
// WalkTransitionRule already called RestyleForAnimation.
}
return;
}
TimeStamp mostRecentRefresh =
presContext->RefreshDriver()->MostRecentRefresh();
const nsTimingFunction &tf = aTransition.GetTimingFunction();
float delay = aTransition.GetDelay();
float duration = aTransition.GetDuration();
if (duration < 0.0) {
// The spec says a negative duration is treated as zero.
duration = 0.0;
}
pt.mStartForReversingTest = pt.mStartValue;
pt.mReversePortion = 1.0;
// We need to check two things if we have a currently running
// transition for this property.
if (currentIndex != nsTArray<ElementPropertyTransition>::NoIndex) {
const ElementPropertyTransition &oldPT =
aElementTransitions->mPropertyTransitions[currentIndex];
if (oldPT.mEndValue == pt.mEndValue) {
// If we got a style change that changed the value to the endpoint
// of the currently running transition, we don't want to interrupt
// its timing function.
// WalkTransitionRule already called RestyleForAnimation.
return;
}
// If the new transition reverses the old one, we'll need to handle
// the timing differently.
if (!oldPT.IsRemovedSentinel() &&
oldPT.mStartForReversingTest == pt.mEndValue) {
// Compute the appropriate negative transition-delay such that right
// now we'd end up at the current position.
double valuePortion =
oldPT.ValuePortionFor(mostRecentRefresh) * oldPT.mReversePortion +
(1.0 - oldPT.mReversePortion);
// A timing function with negative y1 (or y2!) might make
// valuePortion negative. In this case, we still want to apply our
// reversing logic based on relative distances, not make duration
// negative.
if (valuePortion < 0.0)
valuePortion = -valuePortion;
// A timing function with y2 (or y1!) greater than one might
// advance past its terminal value. It's probably a good idea to
// clamp valuePortion to be at most one to preserve the invariant
// that a transition will complete within at most its specified
// time.
if (valuePortion > 1.0)
valuePortion = 1.0;
// Negative delays are essentially part of the transition
// function, so reduce them along with the duration, but don't
// reduce positive delays.
if (delay < 0.0f)
delay *= valuePortion;
duration *= valuePortion;
pt.mStartForReversingTest = oldPT.mEndValue;
pt.mReversePortion = valuePortion;
}
}
pt.mProperty = aProperty;
pt.mStartTime = mostRecentRefresh + TimeDuration::FromMilliseconds(delay);
pt.mDuration = TimeDuration::FromMilliseconds(duration);
pt.mTimingFunction.Init(tf);
if (!aElementTransitions) {
aElementTransitions =
GetElementTransitions(aElement, aNewStyleContext->GetPseudoType(),
true);
if (!aElementTransitions) {
NS_WARNING("allocating ElementTransitions failed");
return;
}
}
nsTArray<ElementPropertyTransition> &pts =
aElementTransitions->mPropertyTransitions;
#ifdef DEBUG
for (uint32_t i = 0, i_end = pts.Length(); i < i_end; ++i) {
NS_ABORT_IF_FALSE(i == currentIndex ||
pts[i].mProperty != aProperty,
"duplicate transitions for property");
}
#endif
if (currentIndex != nsTArray<ElementPropertyTransition>::NoIndex) {
pts[currentIndex] = pt;
} else {
if (!pts.AppendElement(pt)) {
NS_WARNING("out of memory");
return;
}
}
aElementTransitions->UpdateAnimationGeneration(mPresContext);
nsRestyleHint hint =
aNewStyleContext->GetPseudoType() ==
nsCSSPseudoElements::ePseudo_NotPseudoElement ?
eRestyle_Self : eRestyle_Subtree;
presContext->PresShell()->RestyleForAnimation(aElement, hint);
*aStartedAny = true;
aWhichStarted->AddProperty(aProperty);
}
ElementTransitions*
nsTransitionManager::GetElementTransitions(dom::Element *aElement,
nsCSSPseudoElements::Type aPseudoType,
bool aCreateIfNeeded)
{
if (!aCreateIfNeeded && PR_CLIST_IS_EMPTY(&mElementData)) {
// Early return for the most common case.
return nullptr;
}
nsIAtom *propName;
if (aPseudoType == nsCSSPseudoElements::ePseudo_NotPseudoElement) {
propName = nsGkAtoms::transitionsProperty;
} else if (aPseudoType == nsCSSPseudoElements::ePseudo_before) {
propName = nsGkAtoms::transitionsOfBeforeProperty;
} else if (aPseudoType == nsCSSPseudoElements::ePseudo_after) {
propName = nsGkAtoms::transitionsOfAfterProperty;
} else {
NS_ASSERTION(!aCreateIfNeeded,
"should never try to create transitions for pseudo "
"other than :before or :after");
return nullptr;
}
ElementTransitions *et = static_cast<ElementTransitions*>(
aElement->GetProperty(propName));
if (!et && aCreateIfNeeded) {
// FIXME: Consider arena-allocating?
et = new ElementTransitions(aElement, propName, this,
mPresContext->RefreshDriver()->MostRecentRefresh());
nsresult rv = aElement->SetProperty(propName, et,
ElementTransitionsPropertyDtor, false);
if (NS_FAILED(rv)) {
NS_WARNING("SetProperty failed");
delete et;
return nullptr;
}
if (propName == nsGkAtoms::transitionsProperty) {
aElement->SetMayHaveAnimations();
}
AddElementData(et);
}
return et;
}
/*
* nsIStyleRuleProcessor implementation
*/
void
nsTransitionManager::WalkTransitionRule(RuleProcessorData* aData,
nsCSSPseudoElements::Type aPseudoType)
{
ElementTransitions *et =
GetElementTransitions(aData->mElement, aPseudoType, false);
if (!et) {
return;
}
if (aData->mPresContext->IsProcessingRestyles() &&
!aData->mPresContext->IsProcessingAnimationStyleChange()) {
// If we're processing a normal style change rather than one from
// animation, don't add the transition rule. This allows us to
// compute the new style value rather than having the transition
// override it, so that we can start transitioning differently.
// We need to immediately restyle with animation
// after doing this.
if (et) {
nsRestyleHint hint =
aPseudoType == nsCSSPseudoElements::ePseudo_NotPseudoElement ?
eRestyle_Self : eRestyle_Subtree;
mPresContext->PresShell()->RestyleForAnimation(aData->mElement, hint);
}
return;
}
et->EnsureStyleRuleFor(
aData->mPresContext->RefreshDriver()->MostRecentRefresh());
aData->mRuleWalker->Forward(et->mStyleRule);
}
/* virtual */ void
nsTransitionManager::RulesMatching(ElementRuleProcessorData* aData)
{
NS_ABORT_IF_FALSE(aData->mPresContext == mPresContext,
"pres context mismatch");
WalkTransitionRule(aData,
nsCSSPseudoElements::ePseudo_NotPseudoElement);
}
/* virtual */ void
nsTransitionManager::RulesMatching(PseudoElementRuleProcessorData* aData)
{
NS_ABORT_IF_FALSE(aData->mPresContext == mPresContext,
"pres context mismatch");
// Note: If we're the only thing keeping a pseudo-element frame alive
// (per ProbePseudoStyleContext), we still want to keep it alive, so
// this is ok.
WalkTransitionRule(aData, aData->mPseudoType);
}
/* virtual */ void
nsTransitionManager::RulesMatching(AnonBoxRuleProcessorData* aData)
{
}
#ifdef MOZ_XUL
/* virtual */ void
nsTransitionManager::RulesMatching(XULTreeRuleProcessorData* aData)
{
}
#endif
/* virtual */ size_t
nsTransitionManager::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
{
return CommonAnimationManager::SizeOfExcludingThis(aMallocSizeOf);
}
/* virtual */ size_t
nsTransitionManager::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
{
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}
struct TransitionEventInfo {
nsCOMPtr<nsIContent> mElement;
nsTransitionEvent mEvent;
TransitionEventInfo(nsIContent *aElement, nsCSSProperty aProperty,
TimeDuration aDuration)
: mElement(aElement),
mEvent(true, NS_TRANSITION_END,
NS_ConvertUTF8toUTF16(nsCSSProps::GetStringValue(aProperty)),
aDuration.ToSeconds())
{
}
// nsTransitionEvent doesn't support copy-construction, so we need
// to ourselves in order to work with nsTArray
TransitionEventInfo(const TransitionEventInfo &aOther)
: mElement(aOther.mElement),
mEvent(true, NS_TRANSITION_END,
aOther.mEvent.propertyName, aOther.mEvent.elapsedTime)
{
}
};
/* virtual */ void
nsTransitionManager::WillRefresh(mozilla::TimeStamp aTime)
{
NS_ABORT_IF_FALSE(mPresContext,
"refresh driver should not notify additional observers "
"after pres context has been destroyed");
if (!mPresContext->GetPresShell()) {
// Someone might be keeping mPresContext alive past the point
// where it has been torn down; don't bother doing anything in
// this case. But do get rid of all our transitions so we stop
// triggering refreshes.
RemoveAllElementData();
return;
}
FlushTransitions(Can_Throttle);
}
void
nsTransitionManager::FlushTransitions(FlushFlags aFlags)
{
if (PR_CLIST_IS_EMPTY(&mElementData)) {
// no transitions, leave early
return;
}
nsTArray<TransitionEventInfo> events;
TimeStamp now = mPresContext->RefreshDriver()->MostRecentRefresh();
bool didThrottle = false;
// Trim transitions that have completed, post restyle events for frames that
// are still transitioning, and start transitions with delays.
{
PRCList *next = PR_LIST_HEAD(&mElementData);
while (next != &mElementData) {
ElementTransitions *et = static_cast<ElementTransitions*>(next);
next = PR_NEXT_LINK(next);
bool canThrottleTick = aFlags == Can_Throttle &&
et->CanPerformOnCompositorThread(
CommonElementAnimationData::CanAnimateFlags(0)) &&
et->CanThrottleAnimation(now);
NS_ABORT_IF_FALSE(et->mElement->GetCurrentDoc() ==
mPresContext->Document(),
"nsGenericElement::UnbindFromTree should have "
"destroyed the element transitions object");
uint32_t i = et->mPropertyTransitions.Length();
NS_ABORT_IF_FALSE(i != 0, "empty transitions list?");
bool transitionStartedOrEnded = false;
do {
--i;
ElementPropertyTransition &pt = et->mPropertyTransitions[i];
if (pt.IsRemovedSentinel()) {
// Actually remove transitions one throttle-able cycle after their
// completion. We only clear on a throttle-able cycle because that
// means it is a regular restyle tick and thus it is safe to discard
// the transition. If the flush is not throttle-able, we might still
// have new transitions left to process. See comment below.
if (aFlags == Can_Throttle) {
et->mPropertyTransitions.RemoveElementAt(i);
}
} else if (pt.mStartTime + pt.mDuration <= now) {
// Fire transitionend events only for transitions on elements
// and not those on pseudo-elements, since we can't target an
// event at pseudo-elements.
if (et->mElementProperty == nsGkAtoms::transitionsProperty) {
nsCSSProperty prop = pt.mProperty;
if (nsCSSProps::PropHasFlags(prop, CSS_PROPERTY_REPORT_OTHER_NAME))
{
prop = nsCSSProps::OtherNameFor(prop);
}
events.AppendElement(
TransitionEventInfo(et->mElement, prop, pt.mDuration));
}
// Leave this transition in the list for one more refresh
// cycle, since we haven't yet processed its style change, and
// if we also have (already, or will have from processing
// transitionend events or other refresh driver notifications)
// a non-animation style change that would affect it, we need
// to know not to start a new transition for the transition
// from the almost-completed value to the final value.
pt.SetRemovedSentinel();
et->UpdateAnimationGeneration(mPresContext);
transitionStartedOrEnded = true;
} else if (pt.mStartTime <= now && canThrottleTick &&
!pt.mIsRunningOnCompositor) {
// Start a transition with a delay where we should start the
// transition proper.
et->UpdateAnimationGeneration(mPresContext);
transitionStartedOrEnded = true;
}
} while (i != 0);
// We need to restyle even if the transition rule no longer
// applies (in which case we just made it not apply).
NS_ASSERTION(et->mElementProperty == nsGkAtoms::transitionsProperty ||
et->mElementProperty == nsGkAtoms::transitionsOfBeforeProperty ||
et->mElementProperty == nsGkAtoms::transitionsOfAfterProperty,
"Unexpected element property; might restyle too much");
if (!canThrottleTick || transitionStartedOrEnded) {
nsRestyleHint hint = et->mElementProperty == nsGkAtoms::transitionsProperty ?
eRestyle_Self : eRestyle_Subtree;
mPresContext->PresShell()->RestyleForAnimation(et->mElement, hint);
} else {
didThrottle = true;
}
if (et->mPropertyTransitions.IsEmpty()) {
et->Destroy();
// |et| is now a dangling pointer!
et = nullptr;
}
}
}
if (didThrottle) {
mPresContext->Document()->SetNeedStyleFlush();
}
for (uint32_t i = 0, i_end = events.Length(); i < i_end; ++i) {
TransitionEventInfo &info = events[i];
nsEventDispatcher::Dispatch(info.mElement, mPresContext, &info.mEvent);
if (!mPresContext) {
break;
}
}
}
| 36.984183 | 108 | 0.65546 | [
"object"
] |
d068c80ca5237c421e8d1afb5d4bed52259cdef1 | 4,454 | hpp | C++ | src/algorithms/apply_voronoi.hpp | jonancm/viennagrid-python | a56f23ab65cf82b2f06ff546d45c056bb9d326b2 | [
"MIT"
] | null | null | null | src/algorithms/apply_voronoi.hpp | jonancm/viennagrid-python | a56f23ab65cf82b2f06ff546d45c056bb9d326b2 | [
"MIT"
] | 1 | 2015-05-13T08:28:52.000Z | 2015-05-13T08:28:52.000Z | src/algorithms/apply_voronoi.hpp | jonancm/viennagrid-python | a56f23ab65cf82b2f06ff546d45c056bb9d326b2 | [
"MIT"
] | null | null | null | /**
* Copyright (c) 2013 Jonan Cruz-Martin
*
* Distributed under the terms of the MIT license, see the accompanying
* file COPYING or http://opensource.org/licenses/MIT.
*
* @file
* @brief Implement algorithm `apply_voronoi`.
*/
#ifndef ALGORITHMS_APPLY_VORONOI_HPP
#define ALGORITHMS_APPLY_VORONOI_HPP
#include "../domains/linear.hpp"
#include "../domains/triangular.hpp"
#include "../domains/quadrilateral.hpp"
#include "../domains/tetrahedral.hpp"
////////////
// Linear //
////////////
/**
* `apply_voronoi` for linear cartesian 1D domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void LinearCartesian1D_Domain_apply_voronoi(LinearCartesian1D_Domain domain);
/**
* `apply_voronoi` for linear cartesian 2D domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void LinearCartesian2D_Domain_apply_voronoi(LinearCartesian2D_Domain domain);
/**
* `apply_voronoi` for linear cartesian 3D domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void LinearCartesian3D_Domain_apply_voronoi(LinearCartesian3D_Domain domain);
/**
* `apply_voronoi` for linear cylindrical domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void LinearCylindrical3D_Domain_apply_voronoi(LinearCylindrical3D_Domain domain);
/**
* `apply_voronoi` for linear polar domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void LinearPolar2D_Domain_apply_voronoi(LinearPolar2D_Domain domain);
/**
* `apply_voronoi` for linear spherical domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void LinearSpherical3D_Domain_apply_voronoi(LinearSpherical3D_Domain domain);
////////////////
// Triangular //
////////////////
/**
* `apply_voronoi` for triangular cartesian 2D domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void TriangularCartesian2D_Domain_apply_voronoi(TriangularCartesian2D_Domain domain);
/**
* `apply_voronoi` for triangular cartesian 3D domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void TriangularCartesian3D_Domain_apply_voronoi(TriangularCartesian3D_Domain domain);
/**
* `apply_voronoi` for triangular cylindrical domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void TriangularCylindrical3D_Domain_apply_voronoi(TriangularCylindrical3D_Domain domain);
/**
* `apply_voronoi` for triangular polar domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void TriangularPolar2D_Domain_apply_voronoi(TriangularPolar2D_Domain domain);
/**
* `apply_voronoi` for triangular spherical domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void TriangularSpherical3D_Domain_apply_voronoi(TriangularSpherical3D_Domain domain);
///////////////////
// Quadrilateral //
///////////////////
/**
* `apply_voronoi` for quadrilateral cartesian 2D domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void QuadrilateralCartesian2D_Domain_apply_voronoi(QuadrilateralCartesian2D_Domain domain);
/**
* `apply_voronoi` for quadrilateral cartesian 3D domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void QuadrilateralCartesian3D_Domain_apply_voronoi(QuadrilateralCartesian3D_Domain domain);
/**
* `apply_voronoi` for quadrilateral cylindrical domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void QuadrilateralCylindrical3D_Domain_apply_voronoi(QuadrilateralCylindrical3D_Domain domain);
/**
* `apply_voronoi` for quadrilateral polar domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void QuadrilateralPolar2D_Domain_apply_voronoi(QuadrilateralPolar2D_Domain domain);
/**
* `apply_voronoi` for quadrilateral spherical domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void QuadrilateralSpherical3D_Domain_apply_voronoi(QuadrilateralSpherical3D_Domain domain);
/////////////////
// Tetrahedral //
/////////////////
/**
* `apply_voronoi` for tetrahedral cartesian 3D domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void TetrahedralCartesian3D_Domain_apply_voronoi(TetrahedralCartesian3D_Domain domain);
/**
* `apply_voronoi` for tetrahedral cylindrical domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void TetrahedralCylindrical3D_Domain_apply_voronoi(TetrahedralCylindrical3D_Domain domain);
/**
* `apply_voronoi` for tetrahedral spherical domains.
*
* @param domain Domain
*
* @since 0.1.0
*/
void TetrahedralSpherical3D_Domain_apply_voronoi(TetrahedralSpherical3D_Domain domain);
#endif /* end of include guard: ALGORITHMS_APPLY_VORONOI_HPP */
| 21.516908 | 95 | 0.72115 | [
"3d"
] |
d069d46c390bdc1dff80e939e388df2877b165ed | 2,115 | cc | C++ | be/src/util/benchmark-test.cc | suifengzhuliu/impala | 611f4c6f3b18cfcddff3b2956cbb87c295a87655 | [
"Apache-2.0"
] | 1 | 2019-12-14T03:09:50.000Z | 2019-12-14T03:09:50.000Z | be/src/util/benchmark-test.cc | suifengzhuliu/impala | 611f4c6f3b18cfcddff3b2956cbb87c295a87655 | [
"Apache-2.0"
] | null | null | null | be/src/util/benchmark-test.cc | suifengzhuliu/impala | 611f4c6f3b18cfcddff3b2956cbb87c295a87655 | [
"Apache-2.0"
] | 1 | 2020-04-02T18:25:34.000Z | 2020-04-02T18:25:34.000Z | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include "common/object-pool.h"
#include "testutil/gtest-util.h"
#include "util/benchmark.h"
#include "common/names.h"
// This is not much of a test but demonstrates how to use the Benchmark
// utility.
namespace impala {
struct MemcpyData {
char* src;
char* dst;
int size;
};
// Utility class to expose private functions for testing
class BenchmarkTest {
public:
static double Measure(Benchmark::BenchmarkFunction fn, void* data) {
return Benchmark::Measure(fn, data, 50, 10, true);
}
};
void TestFunction(int batch_size, void* d) {
MemcpyData* data = reinterpret_cast<MemcpyData*>(d);
for (int i = 0; i < batch_size; ++i) {
memcpy(data->dst, data->src, data->size);
}
}
TEST(BenchmarkTest, DISABLED_Basic) {
MemcpyData data;
data.src = reinterpret_cast<char*>(malloc(128));
data.dst = reinterpret_cast<char*>(malloc(128));
data.size = 16;
double rate_copy_16 = BenchmarkTest::Measure(TestFunction, &data);
data.size = 128;
double rate_copy_128 = BenchmarkTest::Measure(TestFunction, &data);
cout << "Rate 16 Byte: " << rate_copy_16 << endl;
cout << "Rate 128 Byte: " << rate_copy_128 << endl;
ASSERT_LT(rate_copy_128, rate_copy_16);
free(data.src);
free(data.dst);
}
}
IMPALA_TEST_MAIN();
| 27.828947 | 71 | 0.717258 | [
"object"
] |
d06c710ba0e401b74ff8614a06accb55f19b20ed | 15,016 | hpp | C++ | include/Sora/Parser/Parser.hpp | jamboree/Sora | a75c96452857109e90ff61771991415d880b5b37 | [
"MIT"
] | null | null | null | include/Sora/Parser/Parser.hpp | jamboree/Sora | a75c96452857109e90ff61771991415d880b5b37 | [
"MIT"
] | null | null | null | include/Sora/Parser/Parser.hpp | jamboree/Sora | a75c96452857109e90ff61771991415d880b5b37 | [
"MIT"
] | null | null | null | //===--- Parser.hpp - Sora Language Parser ----------------------*- C++ -*-===//
// Part of the Sora project, licensed under the MIT license.
// See LICENSE.txt in the project root for license information.
//
// Copyright (c) 2019 Pierre van Houtryve
//===----------------------------------------------------------------------===//
#pragma once
#include "Sora/AST/Decl.hpp"
#include "Sora/AST/OperatorKinds.hpp"
#include "Sora/Common/LLVM.hpp"
#include "Sora/Diagnostics/DiagnosticEngine.hpp"
#include "Sora/Diagnostics/DiagnosticsParser.hpp"
#include "Sora/Lexer/Lexer.hpp"
#include "Sora/Parser/ParserResult.hpp"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/SaveAndRestore.h"
#include <functional>
namespace sora {
class ASTContext;
class BlockStmt;
class Expr;
class Identifier;
class Lexer;
class LetDecl;
class Pattern;
class SourceFile;
class StmtCondition;
class TypeRepr;
/// Sora Language Parser
///
/// Note: Parsing method should return nullptr when they fail to parse
/// something and can't recover, and return a value when they successfully
/// recovered. They can also use makeParserErrorResult to create a result
/// with an error bit set to tell the caller that an error occured but
/// we successfully recovered.
/// Alternatively, parsing methods can also use makeParserResult(false, node)
/// to create an error parser result with a value. This can be used to notify
/// the caller that something went wrong during the parsing but it recovered
/// successfully and thus parsing can continue.
class Parser final {
Parser(const Parser &) = delete;
Parser &operator=(const Parser &) = delete;
public:
/// \param sf the SourceFile that this parser will be working on.
/// Its ASTContext, DiagnosticEngine and SourceManager will be used to
/// allocate memory, emit diagnostics and access the file's text.
Parser(SourceFile &file);
/// The ASTContext
ASTContext &ctxt;
/// The Diagnostic Engine
DiagnosticEngine &diagEng;
/// The SourceFile that this parser is working on
SourceFile &sourceFile;
private:
/// The current DeclContext
DeclContext *declContext = nullptr;
/// Our lexer instance
Lexer lexer;
/// The current token being considered by the parser
Token tok;
/// The SourceLoc that's right past-the-end of the last token consumed by the
/// parser.
SourceLoc prevTokPastTheEnd;
/// Whether we can apply the "mut" specifier when parsing a pattern.
bool canApplyMutSpecifier = true;
public:
//===- Source-File Parsing ----------------------------------------------===//
/// Parses a source-file
void parseSourceFile();
//===- Declaration Parsing ----------------------------------------------===//
/// \returns true if the parser is positioned at the start of a declaration.
bool isStartOfDecl() const;
/// Parses a declaration or top-level-declaration.
/// \param isTopLevel if true, only top-level-declarations are allowed, and
/// declarations that can't appear at the top level are diagnosed.
///
/// isStartOfDecl() must return true.
ParserResult<Decl> parseDecl(bool isTopLevel = false);
/// Parses a let-declaration
/// The parser must be positioned on the "let" keyword.
ParserResult<LetDecl> parseLetDecl();
/// Parses a parameter-declaration
/// The parser must be positioned on the identifier.
ParserResult<ParamDecl> parseParamDecl();
/// Parses a parameter-declaration-list
/// The parser must be positioned on the "("
ParserResult<ParamList> parseParamDeclList();
/// Parses a function-declaration.
/// The parser must be positioned on the "func" keyword.
ParserResult<FuncDecl> parseFuncDecl();
//===- Expression Parsing -----------------------------------------------===//
/// Parses an expression
ParserResult<Expr> parseExpr(llvm::function_ref<void()> onNoExpr);
/// Parses an assignement-expression
ParserResult<Expr> parseAssignementExpr(llvm::function_ref<void()> onNoExpr);
/// Consumes an assignement-operator
/// \param result the operator that was found. Will not be changed if no
/// operator was found.
/// \returns SourceLoc() if not found.
SourceLoc consumeAssignementOperator(BinaryOperatorKind &result);
/// Parses a conditional-expression
ParserResult<Expr> parseConditionalExpr(llvm::function_ref<void()> onNoExpr);
/// Binary operator precedences, from highest (0) to lowest (last).
enum class PrecedenceKind : uint8_t {
/// Multiplicative Operators: * / %
Multiplicative = 0,
/// Shift operators: << >>
Shift,
/// Bitwise operators: | ^ &
Bitwise,
/// Additive operators: + -
Additive,
/// Relational operators: == != < <= > >=
Relational,
/// Logical operators: && ||
Logical,
/// Null-Coalescing operator: ??
NullCoalesce,
HighestPrecedence = Multiplicative,
LowestPrecedence = NullCoalesce
};
/// Parses a binary-expression.
///
/// NOTE: This uses precedence-climbing (lowest to highest) in order to
/// respect operator precedences, and \p precedence will be the "starting"
/// precedence (usually it's LowestPrecedence).
ParserResult<Expr>
parseBinaryExpr(llvm::function_ref<void()> onNoExpr,
PrecedenceKind precedence = PrecedenceKind::LowestPrecedence);
/// Consumes an binary-operator
/// \param result the operator that was found. Will not be changed if no
/// operator was found.
/// \returns SourceLoc() if not found
///
/// Note that some binary operators will be ignored when they're at the start
/// of a line, because they can be confused with unary operators. e.g. +
SourceLoc consumeBinaryOperator(BinaryOperatorKind &result,
PrecedenceKind precedence);
/// Parses a cast-expression
ParserResult<Expr> parseCastExpr(llvm::function_ref<void()> onNoExpr);
/// Parses a prefix-expression
ParserResult<Expr> parsePrefixExpr(llvm::function_ref<void()> onNoExpr);
/// Consumes a prefix-operator
/// \param result the operator that was found. Will not be changed if no
/// operator was found.
/// \returns SourceLoc() if not found.
SourceLoc consumePrefixOperator(UnaryOperatorKind &result);
/// Parses a postfix-expression
ParserResult<Expr> parsePostfixExpr(llvm::function_ref<void()> onNoExpr);
/// Parses a member-access on \p base (a suffix).
/// The parser must be positioned on the '.' or '->'
ParserResult<Expr> parseMemberAccessExpr(Expr *base);
/// Parses a primary-expression
ParserResult<Expr> parsePrimaryExpr(llvm::function_ref<void()> onNoExpr);
/// Parses a tuple-expression, returning a TupleExpr/ParenExpr on success.
/// The parser must be positioned on the '('.
ParserResult<Expr> parseTupleExpr();
/// Parses a tuple-expression.
/// The parser must be positioned on the '('.
bool parseTupleExpr(SourceLoc &lParenLoc, SmallVectorImpl<Expr *> &exprs,
SourceLoc &rParenLoc);
//===- Pattern Parsing --------------------------------------------------===//
/// Parses a pattern
ParserResult<Pattern> parsePattern(llvm::function_ref<void()> onNoPat);
/// Parses a tuple-pattern.
/// The parse must be positioned on the '('
ParserResult<Pattern> parseTuplePattern();
//===- Statement Parsing ------------------------------------------------===//
/// \returns true if the parser is positioned at the start of a statement.
bool isStartOfStmt() const;
/// Parses a statement.
/// isStartOfStmt() must return true.
ParserResult<Stmt> parseStmt();
/// Parses a block-statement
/// The parser must be positioned on the "{"
ParserResult<BlockStmt> parseBlockStmt();
/// Parses a return-statement
/// The parser must be positioned on the 'return' keyword.
ParserResult<Stmt> parseReturnStmt();
/// Parses a if-statement.
/// The parser must be positioned on the 'if' keyword.
ParserResult<Stmt> parseIfStmt();
/// Parses a while-statement.
/// The parser must be positioned on the 'while' keyword.
ParserResult<Stmt> parseWhileStmt();
// Parses a condition
/// \param cond where the result will be stored
/// \param name the name of the condition (for diagnostics), e.g. "if".
/// \returns true if no parsing error occured, false otherwise.
bool parseCondition(StmtCondition &cond, StringRef name);
//===- Type Parsing -----------------------------------------------------===//
/// Parses a type. Calls \p onNoType if no type was found.
ParserResult<TypeRepr> parseType(llvm::function_ref<void()> onNoType);
/// Parses a tuple type.
/// The parser must be positioned on the "("
ParserResult<TypeRepr> parseTupleType();
/// Parses a reference type.
/// The parser must be positioned on the "&".
ParserResult<TypeRepr> parseReferenceType();
/// Parses a "maybe" type
/// The parser must be positioned on the "maybe" keyword.
ParserResult<TypeRepr> parseMaybeType();
//===- Other Parsing Utilities ------------------------------------------===//
/// Parses a matching token (parentheses or square/curly brackets).
/// Emits a diagnostic and a note if the token is not found.
/// \param the SourceLoc of the left matching token
/// \param the kind of the right matching token (RParen, RCurly or RSquare)
/// \param customErr if a custom diagnostic is provided, it'll be used
/// instead of the default error message.
/// \returns a valid SourceLoc on success, and invalid one on failure.
SourceLoc parseMatchingToken(SourceLoc lLoc, TokenKind kind,
Optional<TypedDiag<>> customErr = None);
/// Parses a comma-separated list of values.
///
/// \param callBack The element parsing function. Returns a boolean indicating
/// whether parsing should continue. It takes a single argument which is the
/// position of the element we're parsing.
///
/// The callback is always called at least once.
void parseList(llvm::function_ref<bool(size_t)> callback);
/// Parses a comma-separated list of values inside a parentheses.
/// The parser must be positioned on the '('
///
/// \param rParenloc If found, the SourceLoc of the ')' will be stored in this
/// variable. If not found, this is set to prevTokPastTheEnd.
/// \param callBack The element parsing function. Returns
/// true on success, false on parsing error. The callback is not called when
/// the next token is a ')', so you don't need to handle ')' in the callback.
/// \param missingRParenDiag passed to parseMatchingToken
///
/// \returns true on success, false on failure.
bool parseTuple(SourceLoc &rParenLoc,
llvm::function_ref<bool(size_t)> callback,
Optional<TypedDiag<>> missingRParenDiag = None);
//===- Diagnostic Emission ----------------------------------------------===//
/// Emits a diagnostic at \p tok's location.
template <typename... Args>
InFlightDiagnostic
diagnose(const Token &tok, const TypedDiag<Args...> &diag,
typename detail::PassArgument<Args>::type... args) {
return diagnose(tok.getLoc(), diag, args...);
}
/// Emits a diagnostic at \p loc
template <typename... Args>
InFlightDiagnostic
diagnose(SourceLoc loc, const TypedDiag<Args...> &diag,
typename detail::PassArgument<Args>::type... args) {
assert(loc && "Parser can't emit diagnostics without SourceLocs");
return diagEng.diagnose<Args...>(loc, diag, args...);
}
/// Emits a "expected" diagnostic.
/// The diagnostic points at the beginning of the current token, or, if it's
/// at the beginning of a line, right past the end of the previous token
/// consumed by the parser.
template <typename... Args>
InFlightDiagnostic
diagnoseExpected(const TypedDiag<Args...> &diag,
typename detail::PassArgument<Args>::type... args) {
SourceLoc loc;
if (tok.isAtStartOfLine() && prevTokPastTheEnd)
loc = prevTokPastTheEnd;
else
loc = tok.getLoc();
assert(loc && "loc is null?");
return diagEng.diagnose<Args...>(loc, diag, args...);
}
//===- Current DeclContext Management -----------------------------------===//
/// Sets the DeclContext that will be used by the parser.
/// \returns a RAII object that restores the previous DeclContext on
/// destruction.
llvm::SaveAndRestore<DeclContext *> setDeclContextRAII(DeclContext *newDC) {
return {declContext, newDC};
}
/// \returns the current DeclContext used by the parser
DeclContext *getDeclContext() const { return declContext; }
//===- Token Consumption & Peeking --------------------------------------===//
/// Peeks the next token
const Token &peek() const;
/// Consumes the current token, replacing it with the next one.
/// \returns the SourceLoc of the consumed token.
SourceLoc consumeToken();
/// Consumes the current token, replacing it with the next one.
/// This check that the current token's kind is equal to \p kind
/// \returns the SourceLoc of the consumed token.
SourceLoc consume(TokenKind kind) {
assert(tok.getKind() == kind && "Wrong kind!");
return consumeToken();
}
/// Consumes an identifier, putting the result in \p identifier and returning
/// its SourceLoc.
SourceLoc consumeIdentifier(Identifier &identifier);
/// Consumes the current token if its kind is equal to \p kind
/// \returns the SourceLoc of the consumed token, or SourceLoc() if no token
/// was consumed.
SourceLoc consumeIf(TokenKind kind) {
if (tok.is(kind))
return consumeToken();
return SourceLoc();
}
//===- Recovery ---------------------------------------------------------===//
// NOTE: All of those methods will also stop at the EOF token.
//===--------------------------------------------------------------------===//
/// Skips the current token, matching parentheses.
/// (e.g. if the current token is {, this skips until past the next })
void skip();
/// Skips until the next token of kind \p kind without consuming it.
void skipUntil(TokenKind kind);
/// Skips to the next Decl
void skipUntilDecl();
/// Skips until the next tok or newline.
void skipUntilTokOrNewline(TokenKind tok = TokenKind::Invalid);
/// Skips to the next \p tok, Decl or }
void skipUntilTokDeclRCurly(TokenKind tok = TokenKind::Invalid);
/// Skips to the next \p tok, Decl, Stmt or }
void skipUntilTokDeclStmtRCurly(TokenKind tok = TokenKind::Invalid);
//===- Miscellaneous ----------------------------------------------------===//
/// \returns true if the parser has reached EOF
bool isEOF() const { return tok.is(TokenKind::EndOfFile); }
/// \returns an identifier object for the contents (string) of \p tok
Identifier getIdentifier(const Token &tok);
/// \returns the difference between the column number of a and b.
/// e.g if a is column 5, and b is column 4, returns -1.
int getColumnDifference(SourceLoc a, SourceLoc b) const;
};
} // namespace sora | 36.894349 | 80 | 0.660895 | [
"object"
] |
d075aaa2876de98b11d1408c425c7a212b02b7e8 | 35,229 | cpp | C++ | bcaaxmlreader.cpp | rdffg/bcaa_importer | f92e0b39673b5c557540154d4567c53a15adadcd | [
"Apache-2.0"
] | null | null | null | bcaaxmlreader.cpp | rdffg/bcaa_importer | f92e0b39673b5c557540154d4567c53a15adadcd | [
"Apache-2.0"
] | 2 | 2019-05-07T22:49:31.000Z | 2021-08-20T20:03:53.000Z | bcaaxmlreader.cpp | rdffg/bcaa_importer | f92e0b39673b5c557540154d4567c53a15adadcd | [
"Apache-2.0"
] | null | null | null | #include "bcaaxmlreader.h"
//#include "DataAdvice.hxx"
#include <memory>
#include <QDebug>
#include <ios>
#include "QDjango.h"
#include "model/model.h"
#include "saveerror.h"
#include "QDjangoQuerySet.h"
#include "QSqlDatabase"
BcaaXmlReader::BcaaXmlReader(QString filePath, QObject *parent) : QObject(parent)
, continueJob(true)
, m_jurisdictiontypes(std::map<model::minortaxing::JurisdictionType::TaxingJurisdictionType, std::unique_ptr<model::minortaxing::JurisdictionType> >())
, m_filePath(filePath)
{
}
void BcaaXmlReader::loadMinorTaxingJurisdictions() {
auto meta = QMetaEnum::fromType<model::minortaxing::JurisdictionType::TaxingJurisdictionType>();
for (int i = 0; i < meta.keyCount(); ++i) {
auto jurisdiction_type = std::make_unique<model::minortaxing::JurisdictionType>();
jurisdiction_type->setType(static_cast<model::minortaxing::JurisdictionType::TaxingJurisdictionType>(meta.value(i)));
jurisdiction_type->setDescription(meta.key(i));
if (!jurisdiction_type->save()) {
QString err = QString("Failed to insert minor taxing jurisdiction type: ") + jurisdiction_type->lastError().text();
throw SaveError(err);
}
m_jurisdictiontypes.insert(std::make_pair(jurisdiction_type->type(), std::move(jurisdiction_type)));
}
}
void BcaaXmlReader::loadPropertyClassValueTypes() {
auto meta = QMetaEnum::fromType<model::PropertyClassValueType::ValueType>();
for (int i = 0; i < meta.keyCount(); ++i) {
auto valueType = model::PropertyClassValueType::fromValueType(
static_cast<model::PropertyClassValueType::ValueType>(meta.value(i)));
if (!valueType->save())
{
QString err = QString("Failed to insert Property Class Value Type: ") + valueType->lastError().text();
throw SaveError(err);
}
}
}
void BcaaXmlReader::import() {
continueJob = true;
std::unique_ptr<dataadvice::DataAdvice> da;
xml_schema::properties props;
emit message(QString("Opening file ") + m_filePath);
//props.no_namespace_schema_location("DataAdvice.xsd");
props.schema_location("http://data.bcassessment.ca/DataAdvice/Formats/DAX/DataAdvice.xsd", "DataAdvice.xsd");
try {
da = dataadvice::DataAdvice_ (m_filePath.toStdString(), 0 ,props);
} catch (const xml_schema::exception &e) {
// fixme
std::stringstream stream;
stream << "error:";
stream << e;
QString s = QString::fromStdString(stream.str());
qDebug() << "Failed to parse XML file: " << e.what() << s;
QString msg = "Failed to parse XML file: ";
msg += e.what();
emit message(msg);
emit finished();
return;
}
auto db = QSqlDatabase::cloneDatabase(QDjango::database(), "conn_from_thread");
bool success = db.open();
success = QDjango::database().isOpen();
QDjango::setDatabase(db);
QDjango::createTables();
// FIXME: don't drop tables in production!
/* QDjango::dropTables();*/
if (!QDjango::createTables())
{
emit message(QString("Failed to create tables. This is okay if the tables already exist"));
//QDjango::database().close();
//return;
}
try {
QDjango::database().transaction();
loadMinorTaxingJurisdictions();
loadPropertyClassValueTypes();
qDebug() << "Opened XML file...";
emit message("Successfully opened the XML file");
dataadvice::DataAdvice::AssessmentAreas_optional aac = da.get()->AssessmentAreas();
if (aac.present()) {
dataadvice::DataAdvice::AssessmentAreas_type dat = aac.get();
// assessment area
auto aa_seq = dat.AssessmentArea();
for (auto &&a : aa_seq) {
auto aamodel = std::unique_ptr<model::AssessmentArea>(model::AssessmentArea::fromXml(a));
if (!aamodel->save()) {
QString err = QString("Failed to save Assessment Area: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
emit message(QString("Found Assessment Area ") + QString::fromStdString(a.AssessmentAreaCode()));
// jurisdiction
auto juris_seq = a.Jurisdictions().get().Jurisdiction();
for (auto &&juris: juris_seq) {
auto juris_model = std::unique_ptr<model::Jurisdiction>(model::Jurisdiction::fromXml(juris));
emit message(QString("Found Jurisdiction ")
+ juris_model->description());
juris_model->setAssessmentArea(aamodel.get());
if (!juris_model->save()) {
QString err = QString("Failed to save Jurisdiction: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
// folio
auto folio_seq = juris.FolioRecords().get().FolioRecord();
for (auto &&folio : folio_seq) {
if (!continueJob) {
throw SaveError("Job cancelled");
}
auto foliomodel = std::shared_ptr<model::Folio>(model::Folio::fromXml(folio));
foliomodel->setJurisdiction(juris_model.get());
if (!foliomodel->save()) {
QString err = QString("Failed to save Folio: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
emit message(QString(" - ") + foliomodel->rollNumber());
emit folioSaved();
// Folio addresses
if (folio.FolioAddresses().present()) {
auto addr_seq = folio.FolioAddresses().get().FolioAddress();
for (auto &&addr: addr_seq) {
auto addrmodel = std::unique_ptr<model::FolioAddress>(model::FolioAddress::fromXml(addr));
addrmodel->setFolio(foliomodel.get());
if (!addrmodel->save()) {
QString err = QString("Failed to save Folio Address: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
}
}
// Folio Description
if (folio.FolioDescription().present()) {
auto descr = model::FolioDescription::fromXml(folio.FolioDescription().get());
descr->setFolio(foliomodel.get());
if (folio.FolioDescription().get().PredominantManualClass().present())
{
auto manualclass = model::ManualClass::fromXml(folio.FolioDescription().get().PredominantManualClass().get());
if (!manualclass->save())
{
QString err = QString("Failed to save manual class: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
descr->setPredominantManualClass(std::move(manualclass));
}
if (folio.FolioDescription().get().RegionalDistrict().present())
{
auto rd = model::SpecialDistrict::fromXml(folio.FolioDescription().get().RegionalDistrict().get());
if (!rd->save())
{
QString err = QString("Failed to save Special District: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
descr->setRegionalDistrict(std::move(rd));
}
if (folio.FolioDescription().get().SchoolDistrict().present())
{
auto rd = model::SpecialDistrict::fromXml(folio.FolioDescription().get().SchoolDistrict().get());
if (!rd->save())
{
QString err = QString("Failed to save Special District: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
descr->setSchoolDistrict(std::move(rd));
}
if (folio.FolioDescription().get().RegionalHospitalDistrict().present())
{
auto rd = model::SpecialDistrict::fromXml(folio.FolioDescription().get().RegionalHospitalDistrict().get());
if (!rd->save())
{
QString err = QString("Failed to save Special District: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
descr->setRegionalHospitalDistrict(std::move(rd));
}
if (!descr->save())
{
QString err = QString("Failed to save folio description: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
}
// ownership groups
auto own_groups_seq = folio.OwnershipGroups()->OwnershipGroup();
for (auto&& og : own_groups_seq) {
auto groupmodel = std::unique_ptr<model::OwnershipGroup>(model::OwnershipGroup::fromXml(og));
groupmodel->setFolio(foliomodel.get());
if (!groupmodel->save()) {
QString err = QString("Failed to save OwnershipGroup: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
// owners
for (auto &&owner : og.Owners().get().Owner()) {
auto ownermodel = std::unique_ptr<model::Owner>(model::Owner::fromXml(owner));
ownermodel->setOwnershipGroup(groupmodel.get());
if (!ownermodel->save()) {
QString err = QString("Failed to save Owner: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
}
// mailing address
if (og.MailingAddress().present()) {
auto mamodel = std::unique_ptr<model::MailingAddress>(model::MailingAddress::fromXml(og.MailingAddress().get()));
mamodel->setOwnershipGroup(groupmodel.get());
if (!mamodel->save()) {
QString err = QString("failed to save mailing address: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
}
// formatted mailing address
if (og.FormattedMailingAddress().present()) {
auto fma = std::unique_ptr<model::FormattedMailingAddress>(model::FormattedMailingAddress::fromXml(og.FormattedMailingAddress().get()));
fma->setOwnershipGroup(groupmodel.get());
if (!fma->save()) {
QString err = QString("Failed to save formatted mailing address: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
}
}
// minor taxings
if (folio.MinorTaxing().present()) {
// general service
if (folio.MinorTaxing().get().GeneralServices().present()) {
auto gs_seq = folio.MinorTaxing().get().GeneralServices().get().MinorTaxingJurisdiction();
for (auto gs : gs_seq)
{
processMinorTaxJurisdiction(gs, foliomodel, model::minortaxing::JurisdictionType::GeneralService);
}
}
// island trusts
if (folio.MinorTaxing().get().IslandsTrusts().present()) {
auto it_seq = folio.MinorTaxing().get().IslandsTrusts().get().MinorTaxingJurisdiction();
for (auto it : it_seq)
{
processMinorTaxJurisdiction(it, foliomodel, model::minortaxing::JurisdictionType::IslandTrust);
}
}
// electoral areas
if (folio.MinorTaxing().get().ElectoralAreas().present()) {
auto ea_seq = folio.MinorTaxing().get().ElectoralAreas().get().MinorTaxingJurisdiction();
for (auto ea : ea_seq)
{
processMinorTaxJurisdiction(ea, foliomodel, model::minortaxing::JurisdictionType::ElectoralArea);
}
}
// Defined
if (folio.MinorTaxing().get().Defined().present())
{
auto de_seq = folio.MinorTaxing().get().Defined().get().MinorTaxingJurisdiction();
for (auto &&defined: de_seq)
{
processMinorTaxJurisdiction(defined, foliomodel, model::minortaxing::JurisdictionType::Defined);
}
}
// Specified Regional
if (folio.MinorTaxing().get().SpecifiedRegional().present()) {
auto sr_seq = folio.MinorTaxing().get().SpecifiedRegional().get().MinorTaxingJurisdiction();
for (auto &&sr: sr_seq) {
processMinorTaxJurisdiction(sr, foliomodel, model::minortaxing::JurisdictionType::SpecifiedRegional);
}
}
// Service Areas
if (folio.MinorTaxing().get().ServiceAreas().present())
{
auto sa_seq = folio.MinorTaxing().get().ServiceAreas().get().MinorTaxingJurisdiction();
for (auto &&sa: sa_seq) {
processMinorTaxJurisdiction(sa, foliomodel, model::minortaxing::JurisdictionType::ServiceArea);
}
}
// Specified Municipal
if (folio.MinorTaxing().get().SpecifiedMunicipal().present()) {
auto sm_seq = folio.MinorTaxing().get().SpecifiedMunicipal().get().MinorTaxingJurisdiction();
for (auto &&sm: sm_seq) {
processMinorTaxJurisdiction(sm, foliomodel, model::minortaxing::JurisdictionType::SpecifiedMunicipal);
}
}
// Improvement Districts
if (folio.MinorTaxing().get().ImprovementDistricts().present()) {
auto id_seq = folio.MinorTaxing().get().ImprovementDistricts().get().MinorTaxingJurisdiction();
for (auto &&id : id_seq) {
processMinorTaxJurisdiction(id, foliomodel, model::minortaxing::JurisdictionType::ImprovementDistrict);
}
}
// Local Areas
if (folio.MinorTaxing().get().LocalAreas().present()) {
auto la_seq = folio.MinorTaxing().get().LocalAreas().get().MinorTaxingJurisdiction();
for (auto &&la: la_seq) {
processMinorTaxJurisdiction(la, foliomodel, model::minortaxing::JurisdictionType::LocalArea);
}
}
}
// Sales
if (folio.Sales().present())
{
auto sale_seq = folio.Sales().get().Sale();
for (auto &&sale : sale_seq)
{
auto salemodel = model::Sale::fromXml(sale);
salemodel->setFolio(foliomodel.get());
if (!salemodel->save())
{
QString err = QString("Failed to save property sale: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
}
}
// Farm
if (folio.Farms().present())
{
auto farm_seq = folio.Farms().get().Farm();
for (auto &&farm: farm_seq)
{
for (auto &&farmnumber: farm.FarmNumber())
{
auto farmmodel = model::Farm::fromXml(farmnumber);
farmmodel->setFolio(foliomodel.get());
if (!farmmodel->save())
{
QString err = QString("Failed to save property farm: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
}
}
}
// Property valuation
if (folio.Values().present())
{
if (folio.Values().get().Valuation().present())
{
auto te_seq = folio.Values().get().Valuation().get().ValuesByETC();
for (auto &&tevalue: te_seq)
{
auto temodel = model::TaxExemptPropertyClassValue::fromXml(tevalue);
temodel->setFolio(foliomodel.get());
if (!temodel->save())
{
QString err = QString("Failed to save tax exempt value: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
}
}
// BC Transit Values
if (folio.Values().get().BCTransitValues().present())
{
auto transit_seq = folio.Values().get().BCTransitValues().get().PropertyClassValues();
for (auto &&bct : transit_seq)
{
auto valuemodel = processPropertyClassValue(bct, model::PropertyClassValueType::BCTransit);
valuemodel->setFolio(foliomodel.get());
if (!valuemodel->save())
{
QString err = QString("Failed to save BC transit value: ") + valuemodel->lastError().text();
throw SaveError(err);
}
}
}
// General Values
if (folio.Values().get().GeneralValues().present())
{
auto general_seq = folio.Values().get().GeneralValues().get().PropertyClassValues();
for (auto &&general : general_seq) {
auto valuemodel = processPropertyClassValue(general, model::PropertyClassValueType::General);
valuemodel->setFolio(foliomodel.get());
if (!valuemodel->save())
{
QString err = QString("Failed to save General value: ") + valuemodel->lastError().text();
throw SaveError(err);
}
}
}
// School values
if (folio.Values().get().SchoolValues().present()) {
auto school_seq = folio.Values().get().SchoolValues().get().PropertyClassValues();
for (auto &&school: school_seq) {
auto valuemodel = processPropertyClassValue(school, model::PropertyClassValueType::School);
valuemodel->setFolio(foliomodel.get());
if (!valuemodel->save())
{
QString err = QString("Failed to save School value: ") + valuemodel->lastError().text();
throw SaveError(err);
}
}
}
}
// Oil and Gas
if (folio.OilAndGas().present()) {
auto og_seq = folio.OilAndGas().get().OilAndGas();
for (auto &&og : og_seq) {
auto ogmodel = model::OilAndGas::fromXml(og);
ogmodel->setFolio(foliomodel.get());
if (!ogmodel->save()) {
QString err = QString("Failed to save Oil and Gas: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
}
}
// Managed Forest
if (folio.ManagedForests().present()) {
auto mf_seq = folio.ManagedForests().get().ManagedForest();
for (auto mf: mf_seq) {
auto mfmodel = model::ManagedForest::fromXml(mf);
mfmodel->setFolio(foliomodel.get());
if (!mfmodel->save()) {
QString err = QString("Failed to save Managed Forest: ") + QDjango::database().lastError().text();
throw SaveError(err);
}
}
}
}
}
}
}
}
catch (SaveError err) {
QDjango::database().rollback();
QDjango::database().close();
emit message(QString("Error: ") + err.text());
emit finished();
return;
}
QDjango::database().commit();
QDjango::database().close();
emit finished();
}
std::unique_ptr<model::PropertyClassValue> BcaaXmlReader::processPropertyClassValue(
dataadvice::PropertyClassValues const &pcv
, model::PropertyClassValueType::ValueType valueType)
{
auto transitmodel = model::PropertyClassValue::fromXml(pcv);
if (pcv.GrossValues().present())
{
auto grossValues = model::Valuation::fromXml(pcv.GrossValues().get());
if (!grossValues->save()) {
QString err = QString("Failed to save Valuation: ") + grossValues->lastError().text();
throw SaveError(err);
}
transitmodel->setGrossValues(std::move(grossValues));
}
if (pcv.NetValues().present())
{
auto netValues = model::Valuation::fromXml(pcv.NetValues().get());
if (!netValues->save())
{
QString err = QString("Failed to save Valuation: ") + netValues->lastError().text();
throw SaveError(err);
}
transitmodel->setNetValues(std::move(netValues));
}
if (pcv.TaxExemptValues().present())
{
auto taxExemptValues = model::Valuation::fromXml(pcv.TaxExemptValues().get());
if (!taxExemptValues->save())
{
QString err = QString("Failed to save Valuation: ") + taxExemptValues->lastError().text();
throw SaveError(err);
}
transitmodel->setTaxExemptValues(std::move(taxExemptValues));
}
auto valueTypeModel = model::PropertyClassValueType::fromValueType(valueType);
transitmodel->setValueType(std::move(valueTypeModel));
return transitmodel;
}
void BcaaXmlReader::processMinorTaxJurisdiction(dataadvice::MinorTaxingJurisdiction const &mtj
, std::shared_ptr<model::Folio> &folio
, model::minortaxing::JurisdictionType::TaxingJurisdictionType taxType)
{
auto jurisdiction = model::minortaxing::MinorTaxingJurisdiction::fromXml(mtj);
try {
jurisdiction->setJurisdictionType(m_jurisdictiontypes.at(taxType).get());
}
catch (const std::out_of_range&) {
throw SaveError(QString("Failed to find jurisdiction type ") + QString::number(taxType));
}
if (!jurisdiction->save())
{
QString err = QString("Failed to save ")
+ m_jurisdictiontypes[taxType]->description()
+ QDjango::database().lastError().text();
throw SaveError(err);
}
auto minortaxing = std::make_unique<model::minortaxing::MinorTaxing>();
minortaxing->setFolio(folio.get());
minortaxing->setMinorTaxingJurisdiction(jurisdiction.get());
if (!minortaxing->save())
{
QString err = QString("Failed to save ")
+ m_jurisdictiontypes[taxType]->description()
+ QDjango::database().lastError().text();
throw SaveError(err);
}
}
| 65.97191 | 197 | 0.355304 | [
"model"
] |
4ee800796c5d7babf22bb97b13f4264992e71e69 | 622 | hpp | C++ | converter/inc/wavefront/ObjectReader.hpp | LarsHagemann/OrbitEngine | 33e01efaac617c53a701f01729581932fc81e8bf | [
"MIT"
] | null | null | null | converter/inc/wavefront/ObjectReader.hpp | LarsHagemann/OrbitEngine | 33e01efaac617c53a701f01729581932fc81e8bf | [
"MIT"
] | 2 | 2022-01-18T21:31:01.000Z | 2022-01-20T21:02:09.000Z | converter/inc/wavefront/ObjectReader.hpp | LarsHagemann/OrbitEngine | 33e01efaac617c53a701f01729581932fc81e8bf | [
"MIT"
] | null | null | null | #pragma once
#include "Reader.hpp"
#include "orb/OrbIntermediate.hpp"
#include <filesystem>
namespace orbtool
{
namespace fs = std::filesystem;
class WFObjectReader : public Reader
{
private:
bool m_warnOnQuad = true;
bool m_triangulating = false;
std::vector<Vector3f> m_positions;
std::vector<Vector3f> m_normals;
std::vector<Vector2f> m_textures;
private:
void ParseObject();
public:
void WarnOnQuads(bool warn) { m_warnOnQuad = warn; }
bool ReadFile(const fs::path& filepath, OrbIntermediate* intermediate) override;
};
} | 23.037037 | 88 | 0.654341 | [
"vector"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.