static void Usage ( void) { printf ("Usage: %s [Options] [Files]\n\n", CompilerName); Options (); }
void IniFile::AddSection(const std::string& name) { Sections::iterator it = _settings.find( name ); if( it == _settings.end() ) { _settings.insert( make_pair( name, Options() ) ); } }
void Usage ( void) { printf ("Usage: %s [Options] [InputFile]\n\n", CompilerName); Options (); }
namespace VskParser { /// Options struct is additional information that helps building a skeleton /// that can be used in kinematics or dynamics simulation. VSK file format /// itself doesn't provide essential properties for it such as body's shape, /// mass, and inertia. struct Options { /// Resource retriever. LocalResourceRetriever is used if it's nullptr. common::ResourceRetrieverPtr retrieverOrNullptr; /// The default shape for body node is ellipsoid. The size of ellipsoid of /// each body node are determined by the relative transformation from a body /// node and its child body node. defaultEllipsoidSize is used for body /// nodes that don't have child body node. Eigen::Vector3d defaultEllipsoidSize; /// Ratio of shorter radii of each ellipsoid to the longest radius where /// the longest radius is the distance between a body and its child body /// node. double thicknessRatio; /// Density of each ellipsoid that are used to compute mass. double density; /// Lower limit of joint position double jointPositionLowerLimit; /// Upper limit of joint position double jointPositionUpperLimit; /// Joint damping coefficient double jointDampingCoefficient; /// Joint Coulomb friction double jointFriction; /// Remove end BodyNodes with no Shape segment bool removeEndBodyNodes; /// Constructor Options(const common::ResourceRetrieverPtr& retrieverOrNullptr = nullptr, const Eigen::Vector3d& defaultEllipsoidSize = Eigen::Vector3d::Constant(0.05), double thicknessRatio = 0.35, double density = 1e+3, double jointPositionLowerLimit = -math::constantsd::pi(), double jointPositionUpperLimit = +math::constantsd::pi(), double jointDampingCoefficient = 0.1, double jointFriction = 0.0, bool removeEndBodyNodes = false); }; /// Read Skeleton from VSK file dynamics::SkeletonPtr readSkeleton(const common::Uri& fileUri, Options options = Options()); } // namespace VskParser
TEST(ParameterFileMetnoKalman, invalidFile) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; Util::setShowError(false); // Wrongly formatted file EXPECT_FALSE(ParameterFileMetnoKalman::isValid("testing/files/parameters.txt")); EXPECT_DEATH(ParameterFileMetnoKalman(Options("testing/files/parameters.txt")), ".*"); // Empty file EXPECT_FALSE(ParameterFileMetnoKalman::isValid("testing/files/nonexistaiowenwenrewoi.txt")); EXPECT_DEATH(ParameterFileMetnoKalman(Options("testing/files/nonexistaiowenwenrewoi.txt")), ".*"); // One missing value on a row EXPECT_FALSE(ParameterFileMetnoKalman::isValid("testing/files/kalmanInvalid1.txt")); EXPECT_DEATH(ParameterFileMetnoKalman(Options("testing/files/kalmanInvalid1.txt")), ".*"); // Wrong number of columns (header says 20, in reallity its 23) EXPECT_FALSE(ParameterFileMetnoKalman::isValid("testing/files/kalmanInvalid2.txt")); EXPECT_DEATH(ParameterFileMetnoKalman(Options("testing/files/kalmanInvalid2.txt")), ".*"); // Missing number of times in header EXPECT_FALSE(ParameterFileMetnoKalman::isValid("testing/files/kalmanInvalid3.txt")); EXPECT_DEATH(ParameterFileMetnoKalman(Options("testing/files/kalmanInvalid3.txt")), ".*"); // Text in station ID EXPECT_FALSE(ParameterFileMetnoKalman::isValid("testing/files/kalmanInvalid4.txt")); EXPECT_DEATH(ParameterFileMetnoKalman(Options("testing/files/kalmanInvalid4.txt")), ".*"); // Non-existant file EXPECT_FALSE(ParameterFileMetnoKalman::isValid("testing/files/kalman98yewd98ywe89.txt")); EXPECT_DEATH(ParameterFileMetnoKalman(Options("testing/files/kalman98yewd98ywe89.txt")), ".*"); }
static void Usage ( void) { printf ("%s\n", ASL_COMPLIANCE); printf ("Usage: %s [Options] [Files]\n\n", ASL_INVOCATION_NAME); Options (); }
Options VarSelectorFind::makeOptionsObs(std::string iVariable) const { std::stringstream ss; ss << "tag=bogus "; ss << "class=SelectorAnalog obsSet=wfrt.mv-obs analogMetric=normMetric "; ss << "numAnalogs=200 averager=mean normalize=1 dayWidth=365 "; ss << "variables="; ss << iVariable; return Options(ss.str()); }
int LibvlcCamera::PrimeCapture() { Info("Priming capture from %s", mPath.c_str()); StringVector opVect = split(Options(), ","); // Set transport method as specified by method field, rtpUni is default if ( Method() == "rtpMulti" ) opVect.push_back("--rtsp-mcast"); else if ( Method() == "rtpRtsp" ) opVect.push_back("--rtsp-tcp"); else if ( Method() == "rtpRtspHttp" ) opVect.push_back("--rtsp-http"); opVect.push_back("--no-audio"); if ( opVect.size() > 0 ) { mOptArgV = new char*[opVect.size()]; Debug(2, "Number of Options: %d",opVect.size()); for (size_t i=0; i< opVect.size(); i++) { opVect[i] = trimSpaces(opVect[i]); mOptArgV[i] = (char *)opVect[i].c_str(); Debug(2, "set option %d to '%s'", i, opVect[i].c_str()); } } mLibvlcInstance = libvlc_new(opVect.size(), (const char* const*)mOptArgV); if ( mLibvlcInstance == NULL ) { Error("Unable to create libvlc instance due to: %s", libvlc_errmsg()); return -1; } mLibvlcMedia = libvlc_media_new_location(mLibvlcInstance, mPath.c_str()); if ( mLibvlcMedia == NULL ) { Error("Unable to open input %s due to: %s", mPath.c_str(), libvlc_errmsg()); return -1; } mLibvlcMediaPlayer = libvlc_media_player_new_from_media(mLibvlcMedia); if ( mLibvlcMediaPlayer == NULL ) { Error("Unable to create player for %s due to: %s", mPath.c_str(), libvlc_errmsg()); return -1; } libvlc_video_set_format(mLibvlcMediaPlayer, mTargetChroma.c_str(), width, height, width * mBpp); libvlc_video_set_callbacks(mLibvlcMediaPlayer, &LibvlcLockBuffer, &LibvlcUnlockBuffer, NULL, &mLibvlcData); mLibvlcData.bufferSize = width * height * mBpp; // Libvlc wants 32 byte alignment for images (should in theory do this for all image lines) mLibvlcData.buffer = (uint8_t*)zm_mallocaligned(64, mLibvlcData.bufferSize); mLibvlcData.prevBuffer = (uint8_t*)zm_mallocaligned(64, mLibvlcData.bufferSize); mLibvlcData.newImage.setValueImmediate(false); libvlc_media_player_play(mLibvlcMediaPlayer); return 0; }
void MenuPrincipal() { SDL_Event event; int VariablePourSon=0; copt Charger; Comp_menu_princp(&Charger); Blitterc_p(&Charger); int continuer=1; while (continuer) { SDL_WaitEvent(&event); switch( event.type ) { case SDL_QUIT: continuer=0; LibererComposantsMenuPrincipal(&Charger); exit(0); break; case SDL_MOUSEBUTTONUP: if (collision(event.button.x, event.button.y, Charger.pos_jouer)) { continuer=0; LibererComposantsMenuPrincipal(&Charger); Choix(); } else if (collision(event.button.x,event.button.y, Charger.pos_options)) { continuer=0; LibererComposantsMenuPrincipal(&Charger); Options(); } else if (collision(event.button.x,event.button.y, Charger.pos_aide)) { continuer=0; LibererComposantsMenuPrincipal(&Charger); Aide(); } else if (collision(event.button.x,event.button.y, Charger.pos_quit)) { continuer=0; LibererComposantsMenuPrincipal(&Charger); exit(0); } break; case SDL_KEYDOWN: /* Si appui d'une touche */ switch (event.key.keysym.sym) { case SDLK_s: Blitterc_p(&Charger); ModifierSon (&VariablePourSon); break; default: break; } } } }
static void Usage ( void) { printf ("%s\n\n", ASL_COMPLIANCE); ACPI_USAGE_HEADER ("iasl [Options] [Files]"); Options (); }
JobBurner::JobBurner( const JobAssignment & jobAssignment, Slave * slave, int options ) : QObject( slave ) , mSlave( slave ) , mCmd( 0 ) , mJobAssignment( jobAssignment ) , mJob( jobAssignment.job() ) , mLoaded( false ) , mOutputTimer( 0 ) , mMemTimer( 0 ) , mLogFlushTimer( 0 ) , mCheckupTimer( 0 ) , mState( StateNew ) , mOptions( Options(options) ) , mCurrentCopy( 0 ) , mLogFilesReady( false ) , mLogFile( 0 ) , mLogStream( 0 ) , mCmdPid( 0 ) { mOutputTimer = new QTimer( this ); connect( mOutputTimer, SIGNAL( timeout() ), SLOT( updateOutput() ) ); mMemTimer = new QTimer( this ); connect( mMemTimer, SIGNAL( timeout() ), SLOT( checkMemory() ) ); mCheckupTimer = new QTimer( this ); connect( mCheckupTimer, SIGNAL( timeout() ), SLOT( checkup() ) ); mCheckupTimer->start(30000); /* Ensure we are actually assigned some tasks to work on */ mTaskAssignments = mJobAssignment.jobTaskAssignments(); if( mTaskAssignments.isEmpty() ) { jobErrored( QString("JobAssignment has no assigned tasks, Job Assignment key: %1").arg(mJobAssignment.key()) ); return; } // Double check that we are still assigned mJobAssignment.reload(); if( mJobAssignment.jobAssignmentStatus().status() != "ready" ) { LOG_1( "JobAssignment no longer ready, cancelling the burn" ); cancel(); return; } /* Make sure each of the tasks are still valid, some could have already been unassigned or cancelled */ /* Also verify that the jobtask record matches the assignment */ mTasks = JobTask::table()->records( mTaskAssignments.keys( JobTaskAssignment::schema()->field("fkeyjobtask")->pos() ), /*select=*/true, /*useCache=*/false ); foreach( JobTaskAssignment jta, mTaskAssignments ) { JobTask task = jta.jobTask(); if( jta.jobAssignmentStatus().status() != "ready" || task.status() != "assigned" || task.host() != Host::currentHost() ) { LOG_1( QString("JobTask no longer assigned, discarding. keyJobTask: %1 keyJobTaskAssignment: %2 jobtask status: %3 jobtaskassignment status: %4") .arg(task.key()).arg(jta.key()).arg(task.status()).arg(jta.jobAssignmentStatus().status()) ); mTaskAssignments -= jta; mTasks -= task; } }
void MyApplication::run(){ Options option; option.load(*conf); std::string data_db_dir = app_args.work_dir + "/data"; std::string meta_db_dir = app_args.work_dir + "/meta"; log_info("ssdb-server %s", APP_VERSION); log_info("conf_file : %s", app_args.conf_file.c_str()); log_info("log_level : %s", Logger::shared()->level_name().c_str()); log_info("log_output : %s", Logger::shared()->output_name().c_str()); log_info("log_rotate_size : %" PRId64, Logger::shared()->rotate_size()); log_info("main_db : %s", data_db_dir.c_str()); log_info("meta_db : %s", meta_db_dir.c_str()); log_info("cache_size : %d MB", option.cache_size); log_info("block_size : %d KB", option.block_size); log_info("write_buffer : %d MB", option.write_buffer_size); log_info("max_open_files : %d", option.max_open_files); log_info("compaction_speed : %d MB/s", option.compaction_speed); log_info("compression : %s", option.compression.c_str()); log_info("binlog : %s", option.binlog? "yes" : "no"); log_info("sync_speed : %d MB/s", conf->get_num("replication.sync_speed")); SSDB *data_db = NULL; SSDB *meta_db = NULL; data_db = SSDB::open(option, data_db_dir); if(!data_db){ log_fatal("could not open data db: %s", data_db_dir.c_str()); fprintf(stderr, "could not open data db: %s\n", data_db_dir.c_str()); exit(1); } meta_db = SSDB::open(Options(), meta_db_dir); if(!meta_db){ log_fatal("could not open meta db: %s", meta_db_dir.c_str()); fprintf(stderr, "could not open meta db: %s\n", meta_db_dir.c_str()); exit(1); } NetworkServer *net = NULL; SSDBServer *server; net = NetworkServer::init(*conf); server = new SSDBServer(data_db, meta_db, *conf, net); log_info("pidfile: %s, pid: %d", app_args.pidfile.c_str(), (int)getpid()); log_info("ssdb server started."); net->serve(); delete net; delete server; delete meta_db; delete data_db; log_info("%s exit.", APP_NAME); }
void SensApplication::Initialize() { DBG_START_METH("SensApplication::Initialize", dbg_verbosity); const std::string prefix = ""; // I should be getting this somewhere else... Options()->GetIntegerValue("n_sens_steps",n_sens_steps_, prefix.c_str()); Options()->GetBoolValue("run_sens", run_sens_, prefix.c_str()); Options()->GetBoolValue("compute_red_hessian", compute_red_hessian_, prefix.c_str()); // make sure run_sens and skip_finalize_solution_call are consistent if (run_sens_ || compute_red_hessian_) { Options()->SetStringValue("skip_finalize_solution_call", "yes"); } else { Options()->SetStringValue("skip_finalize_solution_call", "no"); } }
void UBasicVolumeComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); if (m_octree.IsValid()) { // Traverse all the nodes and see if they need to be updated, // if so we queue a task. m_octree->Traverse([=](FSparseOctreeNode* node) -> ETraverseOptions { if (node->m_hasChildren) { return ETraverseOptions::Continue; } if (!node->IsUpToDate() && !node->IsSceduled() && !node->IsTaskRunning()) { node->m_lastSceduledForUpdate = FTimespan(0, 0, FPlatformTime::Seconds()); node->m_bTaskRunning = true; FVoreealExtractorOptions Options(TWeakPtr<FSparseOctree>(m_octree), node->m_selfId, node->m_bounds, 0); if (bOverrideExtractor) { Options.bOverrideExtractor = true; Options.ExtractorType = ExtractorType; } SCOPE_CYCLE_COUNTER(STAT_RequestMesh); AddTask(GetVolume(), Options); } return ETraverseOptions::Continue; }); // Get Finished Tasks TSharedPtr<FVoreealMesh> Task; while (FindFinishedTask(Task)) { if (Task.IsValid()) { FVoreealMesh* Mesh = Task.Get(); Mesh->CreateSection(MeshComponent, true); FSparseOctreeNode* Node = m_octree->GetNodeAt(Mesh->GetOptions().Identifier); Node->m_meshLastChanged = FTimespan(0, 0, FPlatformTime::Seconds()); Node->m_bTaskRunning = false; SCOPE_CYCLE_COUNTER(STAT_ReturnMesh); } } } }
IniFile::Options IniFile::GetAllKeyValues(const std::string& section) const { Sections::const_iterator i = _settings.find(section); if (i == _settings.end()) { return Options(); // not found } return i->second; }
GeoJSONVT(const mapbox::geometry::feature_collection<double>& features_, const Options& options_ = Options()) : options(options_) { const uint32_t z2 = std::pow(2, options.maxZoom); auto converted = detail::convert(features_, (options.tolerance / options.extent) / z2); auto features = detail::wrap(converted, double(options.buffer) / options.extent); splitTile(features, 0, 0, 0); }
void CurvBranchingSolver:: markHotStart(OsiTMINLPInterface* tminlp_interface) { if (IsNull(cur_estimator_)) { // Get a curvature estimator cur_estimator_ = new CurvatureEstimator(Jnlst(), Options(), tminlp_interface->problem()); } new_bounds_ = true; new_x_ = true; new_mults_ = true; delete [] solution_; delete [] duals_; solution_ = NULL; duals_ = NULL; numCols_ = tminlp_interface->getNumCols(); numRows_ = tminlp_interface->getNumRows(); solution_ = CoinCopyOfArray(tminlp_interface->problem()->x_sol(), numCols_); duals_ = CoinCopyOfArray(tminlp_interface->problem()->duals_sol(), numRows_ + 2*numCols_); obj_value_ = tminlp_interface->problem()->obj_value(); delete [] orig_d_; delete [] projected_d_; orig_d_ = NULL; projected_d_ = NULL; orig_d_ = new double[numCols_]; projected_d_ = new double[numCols_]; // Get a copy of the current bounds delete [] x_l_orig_; delete [] x_u_orig_; delete [] g_l_orig_; delete [] g_u_orig_; x_l_orig_ = NULL; x_u_orig_ = NULL; g_l_orig_ = NULL; g_u_orig_ = NULL; x_l_orig_ = new Number[numCols_]; x_u_orig_ = new Number[numCols_]; g_l_orig_ = new Number[numRows_]; g_u_orig_ = new Number[numRows_]; #ifndef NDEBUG bool retval = #endif tminlp_interface->problem()-> get_bounds_info(numCols_, x_l_orig_, x_u_orig_, numRows_, g_l_orig_, g_u_orig_); assert(retval); }
/** @throw runtime_error */ void LevCrawlDb::create_new(const char* path, bool deleteIfExists) { if (deleteIfExists) { (void)DestroyDB(path, Options()); } Options options; options.error_if_exists = true; options.create_if_missing = true; Status status = DB::Open(options, path, &mDatabase); if (!status.ok()) { throw std::runtime_error(status.ToString()); } }
void ParseOptions(int argc, char **argv) { g_options = Options(); int i = 1; bool seen_input_file = false; while (i < argc) { if (strcmp("-h", argv[i]) == 0 || strcmp("--help", argv[i]) == 0) { std::cout << usage << std::endl; std::exit(0); } if (strcmp("-s", argv[i]) == 0 || strcmp("--stdlib-path", argv[i]) == 0) { i++; if (i >= argc) { ParseError("expected argument for standard library path"); } g_options.stdlib_path = argv[i++]; continue; } if (strcmp("-w", argv[i]) == 0 || strcmp("--warnings", argv[i]) == 0) { i++; g_options.emit_warnings = true; continue; } if (strcmp("--gc-stress", argv[i]) == 0) { i++; g_options.gc_stress = true; continue; } if (strcmp("--heap-verify", argv[i]) == 0) { i++; g_options.heap_verify = true; continue; } if (!seen_input_file) { seen_input_file = true; g_options.input_file = argv[i++]; } else { std::cout << "unexpected positional argument: " << argv[i] << std::endl; std::exit(1); } } }
void InGameMenuKey() { while (true) { if (_kbhit()) { char mainMenuKey = _getch(); switch (mainMenuKey) { case CREDITS_CONTINUE_CHAR: start = true; break; case SAVE_CHAR: SaveGame(); break; case OPTIONS_CHAR: Options(); break; case FAME_CHAR: HallOfFame(); break; case INSTRUCTIONS_CHAR: Instructions(); break; case MENU_CHAR: Reset(); quit = true; start = true; break; case QUIT_CHAR: quit = true; break; default: toBreak = false; } if (toBreak) { break; } else { toBreak = true; } } } }
bool SimpleGrid::loadCfg(Ogre::ConfigFile &CfgFile) { if (!Module::loadCfg(CfgFile)) { return false; } setOptions( Options(CfgFileManager::_getIntValue(CfgFile, "SG_Complexity"), CfgFileManager::_getSizeValue(CfgFile, "SG_MeshSize"), CfgFileManager::_getFloatValue(CfgFile, "SG_Strength"), CfgFileManager::_getBoolValue(CfgFile, "PG_Smooth"), CfgFileManager::_getBoolValue(CfgFile, "PG_ChoppyWaves"), CfgFileManager::_getFloatValue(CfgFile, "PG_ChoopyStrength"))); return true; }
ParseOBJ::Options::Options(const Any& a) { *this = Options(); a.verifyName("OBJOptions"); AnyTableReader r(a); String s; if (r.getIfPresent("texCoord1Mode", s)) { if (s == "NONE") { texCoord1Mode = NONE; } else if (s == "UNPACK_FROM_TEXCOORD0_Z") { texCoord1Mode = UNPACK_FROM_TEXCOORD0_Z; } else if (s == "TEXCOORD0_ZW") { texCoord1Mode = TEXCOORD0_ZW; } else { a.verify(false, "Unexpected value for texCoord3DMode"); } } r.getIfPresent("stripRefraction", stripRefraction); // r.getIfPresent("sampler", sampler); r.verifyDone(); }
const vector<string> ImageProgram::GetOptions() { vector<string> Options(SImage::NbDataTypes * MaxNbChannels); for (int i = 0; i < SImage::NbDataTypes; i++) { SImage::EDataType Type = SImage::EDataType(i); string options = string("-D ") + GetDataTypeList()[i]; Options[GetProgramId(Type, 1)] = options; for (int j = 2; j <= MaxNbChannels; j++) Options[GetProgramId(Type, j)] = options + " -D NBCHAN=" + to_string(j); } return Options; }
NetworkRemoteSettingsPage::NetworkRemoteSettingsPage(SettingsDialog* dialog) : SettingsPage(dialog), ui_(new Ui_NetworkRemoteSettingsPage) { ui_->setupUi(this); setWindowIcon(IconLoader::Load("ipodtouchicon", IconLoader::Base)); connect(ui_->options, SIGNAL(clicked()), SLOT(Options())); ui_->play_store->installEventFilter(this); // Get presets QList<TranscoderPreset> presets = Transcoder::GetAllPresets(); qSort(presets.begin(), presets.end(), ComparePresetsByName); for (const TranscoderPreset& preset : presets) { ui_->format->addItem( QString("%1 (.%2)").arg(preset.name_, preset.extension_), QVariant::fromValue(preset)); } }
//Program waits for the user to press one of the following keys void MainMenuKey() { while (true) { if (_kbhit()) { char mainMenuKey = _getch(); switch (mainMenuKey) { case NEW_GAME_CHAR: PicksDwarfProperties(); break; case LOAD_CHAR: LoadGame(); break; case OPTIONS_CHAR: Options(); break; case FAME_CHAR: HallOfFame(); break; case CREDITS_CONTINUE_CHAR: Credits(); break; case INSTRUCTIONS_CHAR: Instructions(); break; case QUIT_CHAR: quit = true; break; default: toBreak = false; } if (toBreak) { break; } else { toBreak = true; } } } }
daeWriter::daeWriter(DAE *dae_, const std::string &fileURI, const std::string &directory, const std::string &srcDirectory, const osgDB::ReaderWriter::Options *options, TraversalMode tm, const Options *pluginOptions) : osg::NodeVisitor(tm), dae(dae_), _domLibraryAnimations(NULL), rootName(*dae_), m_CurrentRenderingHint(osg::StateSet::DEFAULT_BIN), _options(options), _pluginOptions(pluginOptions ? *pluginOptions : Options()), _externalWriter(srcDirectory, directory, true, pluginOptions ? pluginOptions->relativiseImagesPathNbUpDirs : 0) { success = true; dae->setDatabase(NULL); dae->setIOPlugin(NULL); // create document dae->getDatabase()->createDocument(fileURI.c_str(), &doc); dom = (domCOLLADA*)doc->getDomRoot(); // create scene and instance visual scene domCOLLADA::domScene *scene = daeSafeCast<domCOLLADA::domScene>(dom->add(COLLADA_ELEMENT_SCENE)); domInstanceWithExtra *ivs = daeSafeCast<domInstanceWithExtra>(scene->add(COLLADA_ELEMENT_INSTANCE_VISUAL_SCENE)); ivs->setUrl("#defaultScene"); // create library visual scenes and a visual scene and the root node lib_vis_scenes = daeSafeCast<domLibrary_visual_scenes>(dom->add(COLLADA_ELEMENT_LIBRARY_VISUAL_SCENES)); vs = daeSafeCast<domVisual_scene>(lib_vis_scenes->add(COLLADA_ELEMENT_VISUAL_SCENE)); vs->setId("defaultScene"); currentNode = daeSafeCast<domNode>(vs->add(COLLADA_ELEMENT_NODE)); currentNode->setId("sceneRoot"); // create Asset // createAssetTag(m_ZUpAxis); // we now call this in the set root node lib_cameras = NULL; lib_effects = NULL; lib_controllers = NULL; lib_geoms = NULL; lib_lights = NULL; lib_mats = NULL; lastDepth = 0; // Clean up caches uniqueNames.clear(); currentStateSet = new osg::StateSet(); }
TEST(ParameterFileMetnoKalman, missingValue) { EXPECT_TRUE(ParameterFileMetnoKalman::isValid("testing/files/kalmanOutputWithMissing.txt")); ParameterFileMetnoKalman file(Options("file=testing/files/kalmanOutputWithMissing.txt")); std::vector<Location> locations = file.getLocations(); ASSERT_EQ(21, locations.size()); Location loc = Location(69.0577,18.5437,0); Parameters par = file.getParameters(0, loc); ASSERT_EQ(1, par.size()); EXPECT_FLOAT_EQ(0.37, par[0]); // Missing value at 3 index, corresponding to time 6 // Nearby interpolated values should also be missing for(int t = 4; t <= 8; t++) { par = file.getParameters(t, loc); ASSERT_EQ(1, par.size()); EXPECT_FLOAT_EQ(Util::MV, par[0]); } }
const vector<string> VectorProgram::GetOptions() { vector<string> Options(SImage::NbDataTypes * NbVersions); for (int i = 0; i < SImage::NbDataTypes; i++) { SImage::EDataType Type = SImage::EDataType(i); int VectorWidth = GetVectorWidth(Type); string options = string("-D VEC_WIDTH=") + to_string(VectorWidth) + " -D " + GetDataTypeList()[i]; Options[GetProgramId(Type, Fast)] = options; Options[GetProgramId(Type, Standard)] = options + " -D WITH_PADDING"; Options[GetProgramId(Type, Unaligned)] = options + " -D WITH_PADDING -D UNALIGNED"; } return Options; }
int main(){ Options o; o.put("lon0",39.0); o.put("E0",500000.0); convs::pt2pt cnv(Datum("wgs84"), Proj("lonlat"), Options(), Datum("pulkovo"), Proj("tmerc"), o); dPoint p( 39 + ((double)rand()/RAND_MAX - 0.5) * 6, // 36..42 ((double)rand()/RAND_MAX - 0.5) * 180); // -90..+90 printf("%.12f %.12f\n",p.x,p.y); int i; for (i=0; i<1000000; i++){ cnv.frw(p); cnv.bck(p); } printf("%.12f %.12f\n",p.x,p.y); }
void FSCSDiff::OnSCSEditorUpdateSelectionFromNodes(const TArray<FSCSEditorTreeNodePtrType>& SelectedNodes) { FText InspectorTitle = FText::GetEmpty(); TArray<UObject*> InspectorObjects; InspectorObjects.Empty(SelectedNodes.Num()); for (auto NodeIt = SelectedNodes.CreateConstIterator(); NodeIt; ++NodeIt) { auto NodePtr = *NodeIt; if(NodePtr.IsValid() && NodePtr->CanEditDefaults()) { InspectorTitle = FText::FromString(NodePtr->GetDisplayString()); InspectorObjects.Add(NodePtr->GetComponentTemplate()); } } if( Inspector.IsValid() ) { SKismetInspector::FShowDetailsOptions Options(InspectorTitle, true); Inspector->ShowDetailsForObjects(InspectorObjects, Options); } }