acme
Foundational cross-platform layer of the ca2 framework
Toggle main menu visibility
Loading...
Searching...
No Matches
array2d.h
1
//
2
// Created by camilo on 2022-10-22 18:21 <3ThomasBorregaardSorensen!!
3
//
4
#pragma once
5
6
7
namespace
acme
8
{
9
10
11
namespace
array2d
12
{
13
14
template
<
typename
A >
15
::collection::count predominant_column_count(A & a)
16
{
17
18
index_to_index column_count;
19
20
for
(::collection::index i = 0; i < a.get_size(); i++)
21
{
22
23
column_count[a[i].get_count()]++;
24
25
}
26
27
::collection::count c = -1;
28
29
::collection::count cMax = -1;
30
31
for
(
auto
& assoc : column_count)
32
{
33
34
if
(assoc.element2() > cMax || (assoc.element2() == cMax && assoc.element1() > c))
35
{
36
37
c = assoc.element1();
38
39
cMax = assoc.element2();
40
41
}
42
43
}
44
45
return
c;
46
47
}
48
49
50
}
//namespace array2d
51
52
53
}
// namespace acme
54
55
56
acme
include "aura/graphics/image/context.h"
Definition
aaaa__defer.h:32
array2d.h
Generated by
1.17.0