Skip to content
Snippets Groups Projects
Commit 4e2fe6b2 authored by David Sehnal's avatar David Sehnal
Browse files

collections

parent d07bca0e
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ import OrdSet from '../structure/collections/ordered-set'
import MSet from '../structure/collections/multi-set'
namespace Iteration {
const U = 1000, V = 1000;
const U = 1000, V = 2500;
const control: number[] = [];
const sets = Object.create(null);
......@@ -51,7 +51,7 @@ namespace Iteration {
export function manual1() {
let s = 0;
for (let i = 0, _i = MSet.componentCount(ms); i < _i; i++) {
for (let i = 0, _i = MSet.getSetCount(ms); i < _i; i++) {
const set = MSet.getSetByIndex(ms, i);
for (let j = 0, _j = OrdSet.size(set); j < _j; j++) {
s += OrdSet.get(set, j);
......
......@@ -28,7 +28,7 @@ namespace MultiSet {
return set.keys;
}
export function componentCount(set: MultiSet): OrderedSet {
export function getSetCount(set: MultiSet): number {
if (typeof set === 'number') return 1;
return OrderedSet.size(set.keys);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment