How to use the tstl.make_pair function in tstl

To help you get started, we’ve selected a few tstl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github samchon / framework / src / templates / parallel / ParallelSystemArray.ts View on Github external
// CONSTRUCT BASIC DATA
		let system_pairs = new std.Vector>();
		let performance_index_average: number = 0.0;

		for (let i: number = 0; i < this.size(); i++)
		{
			let system: ParallelSystem = this.at(i);
			if (system["history_list_"].has(uid) == false)
				continue; // NO HISTORY (HAVE NOT PARTICIPATED IN THE PARALLEL PROCESS)

			// COMPUTE PERFORMANCE INDEX BASIS ON EXECUTION TIME OF THIS PARALLEL PROCESS
			let my_history: PRInvokeHistory = system["history_list_"].get(uid) as PRInvokeHistory;
			let performance_index: number = my_history.computeSize() / my_history.computeElapsedTime();

			// PUSH TO SYSTEM PAIRS AND ADD TO AVERAGE
			system_pairs.push_back(std.make_pair(system, performance_index));
			performance_index_average += performance_index;
		}
		performance_index_average /= system_pairs.size();

		// RE-CALCULATE PERFORMANCE INDEX
		for (let i: number = 0; i < system_pairs.size(); i++)
		{
			// SYSTEM AND NEW PERFORMANCE INDEX BASIS ON THE EXECUTION TIME
			let system: ParallelSystem = system_pairs.at(i).first;
			if (system["enforced_"] == true)
				continue; // PERFORMANCE INDEX IS ENFORCED. DOES NOT PERMIT REVALUATION

			let new_performance: number = system_pairs.at(i).second / performance_index_average;

			// DEDUCT RATIO TO REFLECT THE NEW PERFORMANCE INDEX -> MAXIMUM: 30%
			let ordinary_ratio: number;