Debian Codegraph @

src/util.cpp

raw symbols SCIP
1 /*
2 * Copyright (C) 2016, Mike Walters <[email protected]>
3 *
4 * This file is part of inspectrum.
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "util.h"cxx . . $ `<file>/src/util.h`/
21
22 stdcxx . . $ std/::stringcxx . . $ std/string# formatSIValuecxx . . $ formatSIValue(14a4da2464e078e0).(float value)
23 {
24 stdcxx . . $ std/::mapcxx . . $ std/map#<int, stdcxx . . $ std/::stringcxx . . $ std/string#> prefixes = {cxx . . $ std/map#map(7786ef3e167e36fa).
25 { 9, "G" },
26 { 6, "M" },
27 { 3, "k" },
28 { 0, "" },
29 { -3, "m" },
30 { -6, "ยต" },
31 { -9, "n" },
32 };
33
34 int power = 0;
35 while (value < 1.0f && power > -9) {
36 value *= 1e3;
37 power -= 3;
38 }
39 while (value >= 1e3 && power < 9) {
40 value *= 1e-3;
41 power += 3;
42 }
43 stdcxx . . $ std/::stringstreamcxx . . $ std/stringstream# sscxx . . $ std/__cxx11/basic_stringstream#basic_stringstream(49f6e7a06ebc5aa8).;
44 ss <<cxx . . $ std/basic_ostream#`operator<<`(2b73cd0f0517cf77). value <<cxx . . $ std/`operator<<`(88df5bef833f7f83). prefixes[cxx . . $ std/map#`operator[]`(bbd415b616967878).power];
45 return sscxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f)..strcxx . . $ std/__cxx11/basic_stringstream#str(d33e1a6fd36255f7).();
46 }
47
48 template<> const char* getFileNameFiltercxx . . $ getFileNameFilter(33a1f659e94feb42).<stdcxx . . $ std/::complexcxx . . $ std/complex#<float>>() { return "complex<float> file (*.fc32)"; };
49 template<> const char* getFileNameFiltercxx . . $ getFileNameFilter(33a1f659e94feb42).<float>() { return "float file (*.f32)"; };