static void large0 (void) { large (256); if (mpfr_get_emax () != MPFR_EMAX_MAX) large (mpfr_get_emax ()); large (MPFR_EMAX_MAX); }
int main(){ char str1[10]; char str2[10]; printf("Enter first number\n"); scanf("%s", &str1); printf("Enter second number\n"); scanf("%s", &str2); large(str1, str2); _getch(); return 0; }
void main() { int a, b, c, d; enter(&a, &b, &c, &d); printOut(a, b, c, d); printf("Your largest number is %d\n\n", large(a, b, c, d)); sort(a, b, c, d); system("PAUSE"); }
void Grnn::Trainer::trainEnumerate(Grnn& grnn) { double h, err, hOpt, errOpt; errOpt = large(); for(h = minBandwidth_; h <= maxBandwidth_; h += 0.5*tolerance_) { err = error(grnn, h); if (err < errOpt) { errOpt = err; hOpt = h; } } grnn.setBandwidth(hOpt); }
void Backpropagation::initialise(Mlp& network) { unsigned long I = network.W.columns(); unsigned long J = network.W.rows(); delta = VECTOR(J, 0.0); deltaV = VECTOR(J, 0.0); deltaVPrev = VECTOR(J, 0.0); deltaBiasV = 0.0; deltaBiasVPrev = 0.0; deltaW = MATRIX(J, I, 0.0); deltaWPrev = MATRIX(J, I, 0.0); deltaBiasW = VECTOR(J, 0.0); deltaBiasWPrev = VECTOR(J, 0.0); error = large(); errorPrev = large(); minTestError = large(); epoch = 0; iteration = 0; testCount = 0; }
int main() { many_names small, medium(10), large(12, 15); int gross = 144; float pi = 3.1415, payroll = 12.50; small.display(); small.display(100); small.display(gross,100); small.display(payroll); medium.display(); large.display(pi); return 0; }
node1 *radix_sort(node1 *rec) { node1 *r, *nex; int poc = 0 ; int i, j, k; int larg = large(rec); int m = numdig(larg); /* These statements create pockets */ for(k = 0 ; k < 10; k++) { pocket[k] = (node1 *)malloc(sizeof(node1)); pocket1[k] = (node1 *)malloc(9*sizeof(node1)); } /* These statements initialize pockets */ for(j = 1; j <= m ; j++) { for(i = 0 ; i < 10 ; i++) { pocket[i] = NULL; pocket1[i] = NULL ; } r = rec ; while(r != NULL) { int dig = digit(r->data, j); nex = r->next ; update(dig,r); r = nex; } if(r!= NULL) { int dig = digit(r->data,j); update(dig,r); } while(pocket1[poc] == NULL) poc ++; rec = Make_link(poc, rec); } return(rec); }
int main() { box small("small box "), //Three boxes to work with medium("medium box "), large("large box "); small.set(5, 7); large.set(15, 20); cout << "The area of the "; cout << small.get_area() << "\n"; cout << "The area of the "; cout << medium.get_area() << "\n"; cout << "The area of the "; cout << large.get_area() << "\n"; return 0; }
int hpx_main() { std::vector<double> large(64); auto zip_it_begin = hpx::util::make_zip_iterator(large.begin()); auto zip_it_end = hpx::util::make_zip_iterator(large.end()); hpx::parallel::for_each( hpx::parallel::execution::datapar, zip_it_begin, zip_it_end, [](auto& t) -> void { hpx::util::get<0>(t) = 10.0; }); HPX_TEST_EQ( std::count(large.begin(), large.end(), 10.0), std::ptrdiff_t(large.size())); return hpx::finalize(); // Handles HPX shutdown }
int main() { int t,i; scanf("%d",&t); for(i=1;i<=t;++i) { int n,j,k,len; scanf("%d",&n); int** a = (int**)malloc(n*sizeof(int*)); for(j=0;j<n;++j) { a[j] = (int*)malloc(n*sizeof(int)); for(k=0;k<n;++k) scanf("%d",&a[j][k]); } len = large(a,n); printf("%d\n",len); } return 0; }
bool ZoneLoader::Load(const VSceneListEntry& entry) { Helper::SetupScene(entry); float fLarge = 100000000.f; hkvAlignedBBox large(hkvVec3(-fLarge), hkvVec3(fLarge)); VisVisibilityZone_cl* pVisZone = new VisVisibilityZone_cl(large); Vision::GetSceneManager()->AddVisibilityZone(pVisZone); VisZoneResource_cl* pZone = VisZoneResourceManager_cl::GlobalManager().CreateZone(entry.sScenePath, large); if (pZone == NULL) return false; pZone->EnsureLoaded(); pZone->m_bHandleZone = false; // don't uncache hkvAlignedBBox scenebox; Vision::GetSceneManager()->GetDynamicSceneExtents(scenebox); Helper::LookAtBox(scenebox); return true; }
int hpx_main() { std::vector<double> large(64); auto zip_it_begin = hpx::util::make_zip_iterator(large.begin()); auto zip_it_end = hpx::util::make_zip_iterator(large.end()); hpx::parallel::for_each( hpx::parallel::datapar_execution, zip_it_begin, zip_it_end, [](auto t) { using comp_type = typename hpx::util::tuple_element<0, decltype(t)>::type; using var_type = typename hpx::util::decay<comp_type>::type; var_type mass_density = 0.0; mass_density(mass_density > 0.0) = 7.0; HPX_TEST(all_of(mass_density == 0.0)); }); return hpx::finalize(); // Handles HPX shutdown }
bool PrefabLoader::Load(const VSceneListEntry& entry) { Helper::SetupScene(entry); float fLarge = 100000000.f; hkvAlignedBBox large(hkvVec3(-fLarge), hkvVec3(fLarge)); VisVisibilityZone_cl* pVisZone = new VisVisibilityZone_cl(large); Vision::GetSceneManager()->AddVisibilityZone(pVisZone); // load the prefab file and instantiate once VPrefab* pPrefab = VPrefabManager::GlobalManager().LoadPrefab(entry.sScenePath); if (pPrefab == NULL) return false; VPrefabInstanceInfo info; if (!pPrefab->Instantiate(info)) hkvLog::Info("Failed to instantiate prefab"); hkvAlignedBBox scenebox; Vision::GetSceneManager()->GetDynamicSceneExtents(scenebox); Helper::LookAtBox(scenebox); return true; }
large large::operator-() const { return large( !_neg, _val ); }
bool wxWindowsPrintPreview::RenderPageFragment(float scaleX, float scaleY, int *nextFinalLine, wxPrinterDC& printer, wxMemoryDC& finalDC, const wxRect& rect, int pageNum) { // compute 'rect' equivalent in the small final bitmap: const wxRect smallRect(wxPoint(0, *nextFinalLine), wxPoint(int(rect.GetRight() * scaleX), int(rect.GetBottom() * scaleY))); wxLogTrace("printing", "rendering fragment of page %i: [%i,%i,%i,%i] scaled down to [%i,%i,%i,%i]", pageNum, rect.x, rect.y, rect.GetRight(), rect.GetBottom(), smallRect.x, smallRect.y, smallRect.GetRight(), smallRect.GetBottom() ); // create DC and bitmap compatible with printer DC: wxBitmap large(rect.width, rect.height, printer); if ( !large.IsOk() ) return false; // render part of the page into it: { PageFragmentDC memoryDC(&printer, large, rect.GetPosition(), wxSize(m_pageWidth, m_pageHeight)); if ( !memoryDC.IsOk() ) return false; memoryDC.Clear(); if ( !RenderPageIntoDC(memoryDC, pageNum) ) return false; } // release bitmap from memoryDC // now scale the rendered part down and blit it into final output: wxImage img; { wxDIB dib(large); if ( !dib.IsOk() ) return false; large = wxNullBitmap; // free memory a.s.a.p. img = dib.ConvertToImage(); } // free the DIB now that it's no longer needed, too if ( !img.IsOk() ) return false; img.Rescale(smallRect.width, smallRect.height, wxIMAGE_QUALITY_HIGH); if ( !img.IsOk() ) return false; wxBitmap bmp(img); if ( !bmp.IsOk() ) return false; img = wxNullImage; finalDC.DrawBitmap(bmp, smallRect.x, smallRect.y); if ( bmp.IsOk() ) { *nextFinalLine += smallRect.height; return true; } return false; }
int main() { unsigned int userInputChoice = 0; bool isSchedulingAlgorithmCompleted[6] = { false, false, false, false, false, false }; FileUtility small( smallTaskName, smallInputFileName, smallOutputFileName, smallFileNumberCount, timeQuantum ); FileUtility medium( mediumTaskName, mediumInputFileName, mediumOutputFileName, mediumFileNumberCount, timeQuantum ); FileUtility large( largeTaskName, largeInputFileName, largeOutputFileName, largeFileNumberCount, timeQuantum ); halfTime = ( smallFileNumberCount + mediumFileNumberCount + largeFileNumberCount ) / 2; GenerateInputFiles( small, medium, large ); while( userInputChoice != INPUT_CHOICE_EXIT) { userInputChoice = 0; timeStamp = 0; small.InitialiseMemberVariables(); medium.InitialiseMemberVariables(); large.InitialiseMemberVariables(); cout << endl; cout << "Enter input choice based on the Scheduling algorithm you wish to perform." << endl; cout << "1. First Come First Serve : Small -> Medium -> Large" << endl; cout << "2. First Come First Serve : Large -> Medium -> Small" << endl; cout << "3. Priority Scheduling : Equal priority" << endl; cout << "4. Priority Scheduling : Inverse of the file size" << endl; cout << "5. Priority Scheduling : Proportional to the file size" << endl; cout << "6. Print statistics generated so far" << endl; cout << "7. Exit program." << endl; cout << "Please enter your choice :"; cin >> userInputChoice; switch( userInputChoice ) { RemoveOutputFiles( small, medium, large ); case FCFS_SMALL_TO_LARGE: isSchedulingAlgorithmCompleted[ FCFS_SMALL_TO_LARGE ] = true; FirstComeFirstServe( userInputChoice, small, medium, large ); cout << "Completed generating output files for First Come First Serve : Small -> Medium -> Large." << endl; break; case FCFS_LARGE_TO_SMALL: isSchedulingAlgorithmCompleted[ FCFS_LARGE_TO_SMALL ] = true; FirstComeFirstServe( userInputChoice, large, medium, small ); cout << "Completed generating output files for First Come First Serve : Large -> Medium -> Small." << endl; break; case PS_EQUAL_PRIORITY: isSchedulingAlgorithmCompleted[ PS_EQUAL_PRIORITY ] = true; PrioritySchedulingWithEqualPriority( small, medium, large ); cout << "Completed generating output files for Priority Scheduling : Equal priority." << endl; break; case PS_INVERSE_FILE_SIZE: isSchedulingAlgorithmCompleted[ PS_INVERSE_FILE_SIZE ] = true; PriorityScheduling( userInputChoice, small, medium, large ); cout << "Completed generating output files for Priority Scheduling : Inverse of the file size." << endl; break; case PS_PROPORTIONAL_FILE_SIZE: isSchedulingAlgorithmCompleted[ PS_PROPORTIONAL_FILE_SIZE ] = true; PriorityScheduling( userInputChoice, large, medium, small ); cout << "Completed generating output files for Priority Scheduling : Proportional to the file size." << endl; break; case PRINT_STATISTICS: PrintStatistics( isSchedulingAlgorithmCompleted, small, medium, large ); break; case INPUT_CHOICE_EXIT: break; default: cout << "Incorrect choice entered. Enter correct choice." << endl; break; } } cout << endl; cout << "Exiting program..!" << endl; return 0; }
void testSameKey(){ ContentValue cv; // test data std::string src = "adalkjalfalfalfkal"; const char* data = src.data(); uint32_t data_len = src.length(); std::string data_key = "private_key"; cv.put(data_key, data_len, data); std::string other_src = "daldko5202402224"; data_len = other_src.length(); data = other_src.data(); cv.put(data_key, data_len, data); uint32_t val_len; char* val; cv.getAsData(data_key, val_len, val); std::string str_val(val, val_len); CHECK(str_val == other_src); // now check string std::string key = "peer"; cv.put(key, std::string("sexy_girl")); cv.put(key, std::string("manly man")); std::string val_str; cv.getAsString(key, val_str); CHECK(val_str == "manly man"); // and double cv.put(key, 4.); cv.put(key, 32.); double val_d; cv.getAsDouble(key, val_d); CHECK(val_d == 32.); // and int64 int64_t large(20420492040123); cv.put(key, large); cv.put(key, large+34); int64_t val_i64; cv.getAsInt64(key, val_i64); CHECK(val_i64 == large+34); // and bool cv.put(key, false); cv.put(key, true); bool bool_val = false; cv.getAsBool(key, bool_val); CHECK(bool_val == true); // and int32 int32_t medium = 20432123; cv.put(key, medium); cv.put(key, medium+34); int32_t val_i32; cv.getAsInt32(key, val_i32); CHECK(val_i32 == medium+34); REPORT("testSameKey()"); }
/** @SYMTestCaseID APPFWK-APPARC-0070 @SYMPREQ @SYMTestCaseDesc Test whether the default app icons change with respect to the locale/language. This testcase checks whether BaflUtils::NearestLanguageFile is called when the locale has been changed. @SYMTestPriority High @SYMTestStatus Implemented @SYMTestActions Call User::Language() to check that the default locale is English; Call CT_LocaleStep::CheckIcons to check the size of the current default icons; Call UserSvr::ChangeLocale to change the Locale to French; Call CT_LocaleStep::CheckIcons to check the size of the new icons; Restore the file system and the locale and check if the icons are restored. API Calls:\n @SYMTestExpectedResults Returns KErrNone */ void CT_LocaleStep::TestLocaleDefaultIconL() { INFO_PRINTF1(_L("APPFWK-APPARC-0070: TestLocaleDefaultIconL started...")); TInt ret = 0; //first checks that language is not currently set to French (any other language except English since English is the default language TEST(User::Language()!=ELangFrench); // getappiconsizes must be called to check if the icons are the default ones // KUidCustomiseDefaultIconApp - uid of CustomiseDefaultIconApp_reg.RSS; this app has a localisable resource file, CustomiseDefaultIconApp_loc.RSS, that does not define any icon // Hence, the default icons must be picked up when the language changes to French. The default icons for French are defined in default_app_icon.m02 CArrayFixFlat<TSize>* newIconSizes = new(ELeave) CArrayFixFlat<TSize>(3); CleanupStack::PushL(newIconSizes); TRAP(ret,iLs.GetAppIconSizes(KUidCustomiseDefaultIconApp, *newIconSizes)); TEST(ret==KErrNone); TEST(newIconSizes->Count()!=0); // these are the sizes of the default icons TSize small(24,24); TSize medium(32,32); TSize large(48,48); TSize fstIcon; TSize secIcon; TSize trdIcon; CheckIcons(newIconSizes, small, medium,large, fstIcon, secIcon, trdIcon); // Change the locale to French TRAP(ret,ChangeLocaleL(ELangFrench)); TEST(ret==KErrNone); TEST(User::Language()==ELangFrench);//checks that the language has been set to French //Wait for a small period to let apparc receive language change notification User::After(KDelayForOnDemand); //call getappiconsizes to see if the new icons have been changed as as expected // The size of the icons indicates whether the icon corresponding to French Locale has been picked up newIconSizes->Reset(); TRAP(ret,iLs.GetAppIconSizes(KUidCustomiseDefaultIconApp, *newIconSizes)); TEST(ret==KErrNone); TEST(newIconSizes->Count()!=0); small.SetSize(25,25); medium.SetSize(35,35); large.SetSize(50,50); CheckIcons(newIconSizes, small, medium,large, fstIcon, secIcon, trdIcon); //have to restore the locale before exiting the testcase TRAP(ret,ChangeLocaleL(ELangEnglish)); TEST(ret==KErrNone); TEST(User::Language()==ELangEnglish); //Again wait for a small period to let apparc receive language change notification User::After(KDelayForOnDemand); //call getappiconsizes to see if the new icons have been changed as as expected // The size of the icons indicates whether the icon corresponding to English Locale has been picked up newIconSizes->Reset(); TRAP(ret,iLs.GetAppIconSizes(KUidCustomiseDefaultIconApp, *newIconSizes)); TEST(ret==KErrNone); TEST(newIconSizes->Count()!=0); small.SetSize(24,24); medium.SetSize(32,32); large.SetSize(48,48); CheckIcons(newIconSizes, small, medium,large, fstIcon, secIcon, trdIcon); // Icon cleanup CleanupStack::PopAndDestroy(newIconSizes); newIconSizes=NULL; INFO_PRINTF1(_L("APPFWK-APPARC-0070: TestLocaleDefaultIconL finished...")); }
void KMplex::sample(KEY& T, KEY& S) { if(T.size() <= 2) { greedy(T, S); return; } // NOTE: Cannot sample for two or less data, so copy any data to S // Indices of points a and b KEY::iterator a; KEY::iterator b; // Corresponding distances to points a and b, from c(S) double da = 0.0; double db = 0.0; for(KEY::iterator t = T.begin(); t != T.end(); ++t) { // Find shortest distance d(t,s) double d = large(); for(KEY::iterator s = S.begin(); s != S.end(); ++s) { if(D_[*t][*s] < d) d = D_[*t][*s]; } // Retain t if corresponds to first or second farthest from S if(d >= da) { b = a; // Farthest object moves to second farthest db = da; a = t; // New object t is farthest from s in S da = d; } else if(d >= db) // New object t is second farthest from s in S { b = t; db = d; } else { ; // Do nothing } } // Indices a and b are moved to sample, S S.push_back(*a); S.push_back(*b); // Erase items a and b, starting with last in sequence if(a > b) { T.erase(a); T.erase(b); } else { T.erase(b); T.erase(a); } }