23 #ifndef O2SCL_CONVERT_UNITS_H
24 #define O2SCL_CONVERT_UNITS_H
35 #include <o2scl/misc.h>
36 #include <o2scl/constants.h>
37 #include <o2scl/string_conv.h>
39 #ifndef DOXYGEN_NO_O2NS
107 #ifndef DOXYGEN_INTERNAL
122 std::map<std::string,unit_t,std::greater<std::string> >
mcache;
125 typedef typename std::map<std::string,unit_t,
126 std::greater<std::string> >::iterator
miter;
129 typedef typename std::map<std::string,unit_t,
130 std::greater<std::string> >::const_iterator
mciter;
145 fp_t val, fp_t &converted,
146 fp_t &factor,
bool &new_conv)
const {
162 std::cout <<
"convert_units::convert(): "
163 <<
"Value of use_gnu_units is true." << std::endl;
176 std::cout <<
"convert_units::convert(): "
177 <<
"Value of use_gnu_units is false." << std::endl;
183 std::string str=((std::string)
"Conversion between ")+from+
" and "+to+
184 " not found in convert_units::convert_ret().";
204 fp_t val, fp_t &converted,
205 fp_t &factor,
bool &new_conv)
const {
210 std::cout <<
"convert_units::convert_gnu_units(): "
211 <<
"Units command is " << cmd << std::endl;
217 std::cout <<
"convert_units::convert_gnu_units(): "
218 <<
"Define constant popen is defined." << std::endl;
221 std::cout <<
"Using GNU units: " << cmd << std::endl;
222 FILE *ps_pipe=popen(cmd.c_str(),
"r");
236 char *cret=fgets(line1,80,ps_pipe);
238 std::cout <<
"convert_units::convert_gnu_units(): "
239 <<
"Units output is " << line1 << std::endl;
244 std::string s=line1, t1, t2;
245 std::istringstream *ins=
new std::istringstream(s);
249 std::cout <<
"convert_units::convert_gnu_units(): "
250 <<
"Units string to convert is "
256 std::string str=((std::string)
"Conversion between ")+from+
" and "+to+
257 " not found in convert_units::convert_gnu_units().";
263 std::cout <<
"convert_units::convert_gnu_units(): "
264 <<
"Converted value is "
265 << factor*val << std::endl;
269 if (pclose(ps_pipe)!=0) {
272 "convert_units::convert_gnu_units().",
exc_efailed);
277 converted=factor*val;
282 std::cout <<
"convert_units::convert_gnu_units(): "
283 <<
"Define constant popen is not defined." << std::endl;
302 fp_t val, fp_t &converted,
303 fp_t &factor)
const {
306 std::string both=from+
","+to;
310 converted=val*factor;
315 std::string both2=to+
","+from;
318 factor=1.0/m3->second.c;
319 converted=val*factor;
327 if (m->second.f==from) {
328 std::string b=m->second.t+
","+to;
332 std::cout <<
"Using conversions: " << m->second.f <<
" , "
333 << m->second.t <<
" " << m->second.c << std::endl;
334 std::cout <<
" (1) and: " << m2->second.f <<
" , "
335 << m2->second.t <<
" " << m2->second.c << std::endl;
337 factor=m->second.c*m2->second.c;
338 converted=val*factor;
341 std::string b2=to+
","+m->second.t;
345 std::cout <<
"Using conversions: " << m->second.f <<
" , "
346 << m->second.t << std::endl;
347 std::cout <<
" (2) and: " << m4->second.f <<
" , "
348 << m4->second.t << std::endl;
350 factor=m->second.c/m4->second.c;
351 converted=val*factor;
354 }
else if (m->second.t==from) {
355 std::string b=m->second.f+
","+to;
359 std::cout <<
"Using conversions: " << m->second.f <<
" , "
360 << m->second.t << std::endl;
361 std::cout <<
" (3) and: " << m2->second.f <<
" , "
362 << m2->second.t << std::endl;
364 factor=m2->second.c/m->second.c;
365 converted=val*factor;
368 }
else if (m->second.f==to) {
369 std::string b=m->second.t+
","+from;
373 std::cout <<
"Using conversions: " << m->second.f <<
" , "
374 << m->second.t << std::endl;
375 std::cout <<
" (4) and: " << m2->second.f <<
" , "
376 << m2->second.t << std::endl;
378 factor=1.0/m->second.c/m2->second.c;
379 converted=val*factor;
382 std::string b2=from+
","+m->second.t;
386 std::cout <<
"Using conversions: " << m->second.f <<
" , "
387 << m->second.t << std::endl;
388 std::cout <<
" (5) and: " << m4->second.f <<
" , "
389 << m4->second.t << std::endl;
391 factor=m4->second.c/m->second.c;
392 converted=val*factor;
395 }
else if (m->second.t==to) {
396 std::string b=m->second.f+
","+from;
400 std::cout <<
"Using conversions: " << m->second.f <<
" , "
401 << m->second.t << std::endl;
402 std::cout <<
" (6) and: " << m2->second.f <<
" , "
403 << m2->second.t << std::endl;
405 factor=m->second.c/m2->second.c;
406 converted=val*factor;
439 virtual fp_t
convert(std::string from, std::string to, fp_t val) {
443 O2SCL_ERR(
"Pipe could not be opened in convert_units::convert().",
447 O2SCL_ERR(
"Pipe could not be closed in convert_units::convert().",
451 std::string str=((std::string)
"Conversion between ")+from+
" and "+to+
452 " not found in convert_units::convert().";
466 std::string str=((std::string)
"Conversion between ")+from+
" and "+to+
467 " not found in convert_units::convert().";
501 virtual int convert_ret(std::string from, std::string to, fp_t val,
508 if (ret==0 && new_conv) {
514 std::string both=from+
","+to;
515 mcache.insert(make_pair(both,ut));
526 fp_t val, fp_t &converted)
const {
545 (from.find(
',')!=std::string::npos ||
546 to.find(
',')!=std::string::npos)) {
547 O2SCL_ERR(
"Units cannot contain comma in insert_cache()",
555 std::string both=from+
","+to;
564 mcache.insert(make_pair(both,ut));
572 std::cout <<
"No units in cache." << std::endl;
574 std::cout <<
"Unit cache: " << std::endl;
576 std::cout.setf(std::ios::left);
578 std::cout << m->second.f <<
" ";
580 std::cout << m->second.t <<
" ";
581 std::cout.unsetf(std::ios::left);
582 std::cout.precision(10);
583 std::cout << m->second.c << std::endl;
595 std::string both=from+
","+to;
604 O2SCL_ERR((((std::string)
"Conversion ")+from+
" -> "+to+
605 " not found in convert_units::remove_cache().").c_str(),
627 fp_t hc=o2scl_const::hc_mev_fm_f<fp_t>();
628 fp_t elem_charge=o2scl_const::elem_charge_f<fp_t>();
751 bool hbar_1=
false,
bool K_1=
false)
const {
753 std::ofstream fout(fname.c_str());
757 fp_t elem_charge=o2scl_const::elem_charge_f<fp_t>();
760 fout <<
"/ ----------------------------------------------"
761 <<
"--------------" << std::endl;
762 fout <<
"/ Fundamental units" << std::endl;
764 fout <<
"################################################"
765 <<
"##############" << std::endl;
766 fout <<
"# Fundamental units" << std::endl;
768 fout <<
"m\t!" << std::endl;
769 fout <<
"meter\tm" << std::endl;
771 fout <<
"s\t!" << std::endl;
772 fout <<
"second\ts" << std::endl;
774 fout <<
"s\t" << sol_mks <<
" m" << std::endl;
775 fout <<
"second\ts" << std::endl;
778 fout <<
"kg\t!" << std::endl;
779 fout <<
"kilogram\tkg" << std::endl;
782 <<
" s / m^2" << std::endl;
783 fout <<
"kilogram\tkg" << std::endl;
785 fout <<
"A\t!" << std::endl;
786 fout <<
"ampere\tA" << std::endl;
787 fout <<
"amp\tA" << std::endl;
788 fout <<
"cd\t!" << std::endl;
789 fout <<
"candela\tcd" << std::endl;
790 fout <<
"mol\t!" << std::endl;
791 fout <<
"mole\tmol" << std::endl;
793 fout <<
"K\t!" << std::endl;
794 fout <<
"kelvin\tK" << std::endl;
797 fout <<
"kelvin\tK" << std::endl;
799 fout <<
"radian\t!" << std::endl;
800 fout <<
"sr\t!" << std::endl;
801 fout <<
"steradian\tsr" << std::endl;
802 fout <<
"US$\t!" << std::endl;
803 fout <<
"bit\t!" << std::endl;
807 fout <<
"/ ----------------------------------------------"
808 <<
"--------------" << std::endl;
809 fout <<
"/ " << std::endl;
811 fout <<
"################################################"
812 <<
"##############" << std::endl;
813 fout <<
"# SI and common prefixes" << std::endl;
815 fout <<
"yotta-\t\t1e24" << std::endl;
816 fout <<
"zetta-\t\t1e21" << std::endl;
817 fout <<
"exa-\t\t1e18" << std::endl;
818 fout <<
"peta-\t\t1e15" << std::endl;
819 fout <<
"tera-\t\t1e12" << std::endl;
820 fout <<
"giga-\t\t1e9" << std::endl;
821 fout <<
"mega-\t\t1e6" << std::endl;
822 fout <<
"myria-\t\t1e4" << std::endl;
823 fout <<
"kilo-\t\t1e3" << std::endl;
824 fout <<
"hecto-\t\t1e2" << std::endl;
825 fout <<
"deca-\t\t1e1" << std::endl;
826 fout <<
"deka-\t\tdeca" << std::endl;
827 fout <<
"deci-\t\t1e-1" << std::endl;
828 fout <<
"centi-\t\t1e-2" << std::endl;
829 fout <<
"milli-\t\t1e-3" << std::endl;
830 fout <<
"micro-\t\t1e-6" << std::endl;
831 fout <<
"nano-\t\t1e-9" << std::endl;
832 fout <<
"pico-\t\t1e-12" << std::endl;
833 fout <<
"femto-\t\t1e-15" << std::endl;
834 fout <<
"atto-\t\t1e-18" << std::endl;
835 fout <<
"zepto-\t\t1e-21" << std::endl;
836 fout <<
"yocto-\t\t1e-24" << std::endl;
837 fout <<
"quarter-\t1|4" << std::endl;
838 fout <<
"semi-\t\t0.5" << std::endl;
839 fout <<
"demi-\t\t0.5" << std::endl;
840 fout <<
"hemi-\t\t0.5" << std::endl;
841 fout <<
"half-\t\t0.5" << std::endl;
842 fout <<
"fp_t-\t\t2" << std::endl;
843 fout <<
"triple-\t\t3" << std::endl;
844 fout <<
"treble-\t\t3" << std::endl;
848 fout <<
"/ ----------------------------------------------"
849 <<
"--------------" << std::endl;
850 fout <<
"/ " << std::endl;
852 fout <<
"################################################"
853 <<
"##############" << std::endl;
854 fout <<
"# SI prefix abbreviations" << std::endl;
856 fout <<
"Y- yotta" << std::endl;
857 fout <<
"Z- zetta" << std::endl;
858 fout <<
"E- exa" << std::endl;
859 fout <<
"P- peta" << std::endl;
860 fout <<
"T- tera" << std::endl;
861 fout <<
"G- giga" << std::endl;
862 fout <<
"M- mega" << std::endl;
863 fout <<
"k- kilo" << std::endl;
864 fout <<
"h- hecto" << std::endl;
865 fout <<
"da- deka" << std::endl;
866 fout <<
"d- deci" << std::endl;
867 fout <<
"c- centi" << std::endl;
868 fout <<
"m- milli" << std::endl;
869 fout <<
"n- nano" << std::endl;
870 fout <<
"p- pico" << std::endl;
871 fout <<
"f- femto" << std::endl;
872 fout <<
"a- atto" << std::endl;
873 fout <<
"z- zepto" << std::endl;
874 fout <<
"y- yocto" << std::endl;
878 fout <<
"/ ----------------------------------------------"
879 <<
"--------------" << std::endl;
880 fout <<
"/ " << std::endl;
882 fout <<
"################################################"
883 <<
"##############" << std::endl;
884 fout <<
"# Basic numbers" << std::endl;
886 fout <<
"one 1" << std::endl;
887 fout <<
"two 2" << std::endl;
888 fout <<
"fp_t 2" << std::endl;
889 fout <<
"couple 2" << std::endl;
890 fout <<
"three 3" << std::endl;
891 fout <<
"triple 3" << std::endl;
892 fout <<
"four 4" << std::endl;
893 fout <<
"quadruple 4" << std::endl;
894 fout <<
"five 5" << std::endl;
895 fout <<
"quintuple 5" << std::endl;
896 fout <<
"six 6" << std::endl;
897 fout <<
"seven 7" << std::endl;
898 fout <<
"eight 8" << std::endl;
899 fout <<
"nine 9" << std::endl;
900 fout <<
"ten 10" << std::endl;
901 fout <<
"twenty 20" << std::endl;
902 fout <<
"thirty 30" << std::endl;
903 fout <<
"forty 40" << std::endl;
904 fout <<
"fifty 50" << std::endl;
905 fout <<
"sixty 60" << std::endl;
906 fout <<
"seventy 70" << std::endl;
907 fout <<
"eighty 80" << std::endl;
908 fout <<
"ninety 90" << std::endl;
909 fout <<
"hundred 100" << std::endl;
910 fout <<
"thousand 1000" << std::endl;
911 fout <<
"million 1e6" << std::endl;
912 fout <<
"billion 1e9" << std::endl;
913 fout <<
"trillion 1e12" << std::endl;
914 fout <<
"quadrillion 1e15" << std::endl;
915 fout <<
"quintillion 1e18" << std::endl;
916 fout <<
"sextillion 1e21" << std::endl;
917 fout <<
"septillion 1e24" << std::endl;
918 fout <<
"octillion 1e27" << std::endl;
919 fout <<
"nonillion 1e30" << std::endl;
920 fout <<
"noventillion nonillion" << std::endl;
921 fout <<
"decillion 1e33" << std::endl;
922 fout <<
"undecillion 1e36" << std::endl;
923 fout <<
"duodecillion 1e39" << std::endl;
924 fout <<
"tredecillion 1e42" << std::endl;
925 fout <<
"quattuordecillion 1e45" << std::endl;
926 fout <<
"quindecillion 1e48" << std::endl;
927 fout <<
"sexdecillion 1e51" << std::endl;
928 fout <<
"septendecillion 1e54" << std::endl;
929 fout <<
"octodecillion 1e57" << std::endl;
930 fout <<
"novemdecillion 1e60" << std::endl;
931 fout <<
"vigintillion 1e63" << std::endl;
932 fout <<
"googol 1e100" << std::endl;
933 fout <<
"centillion 1e303" << std::endl;
937 fout <<
"/ ----------------------------------------------"
938 <<
"--------------" << std::endl;
939 fout <<
"/ " << std::endl;
941 fout <<
"################################################"
942 <<
"##############" << std::endl;
943 fout <<
"# Basic SI units" << std::endl;
945 fout <<
"newton kg m / s^2 " << std::endl;
946 fout <<
"N newton" << std::endl;
947 fout <<
"pascal N/m^2 " << std::endl;
948 fout <<
"Pa pascal" << std::endl;
949 fout <<
"joule N m " << std::endl;
950 fout <<
"J joule" << std::endl;
951 fout <<
"watt J/s " << std::endl;
952 fout <<
"W watt" << std::endl;
953 fout <<
"coulomb A s " << std::endl;
954 fout <<
"C coulomb" << std::endl;
955 fout <<
"volt W/A " << std::endl;
956 fout <<
"V volt" << std::endl;
957 fout <<
"ohm V/A " << std::endl;
958 fout <<
"siemens A/V " << std::endl;
959 fout <<
"S siemens" << std::endl;
960 fout <<
"farad C/V " << std::endl;
961 fout <<
"F farad" << std::endl;
962 fout <<
"weber V s " << std::endl;
963 fout <<
"Wb weber" << std::endl;
964 fout <<
"henry Wb/A " << std::endl;
965 fout <<
"H henry" << std::endl;
966 fout <<
"tesla Wb/m^2 " << std::endl;
967 fout <<
"T tesla" << std::endl;
968 fout <<
"hertz 1/s " << std::endl;
969 fout <<
"Hz hertz" << std::endl;
970 fout <<
"gram millikg " << std::endl;
971 fout <<
"g gram" << std::endl;
975 fout <<
"/ ----------------------------------------------"
976 <<
"--------------" << std::endl;
977 fout <<
"/ " << std::endl;
979 fout <<
"################################################"
980 <<
"##############" << std::endl;
981 fout <<
"# Dimensional analysis units" << std::endl;
983 fout <<
"LENGTH meter" << std::endl;
984 fout <<
"AREA LENGTH^2" << std::endl;
985 fout <<
"VOLUME LENGTH^3" << std::endl;
986 fout <<
"MASS kilogram" << std::endl;
987 fout <<
"CURRENT ampere" << std::endl;
988 fout <<
"AMOUNT mole" << std::endl;
989 fout <<
"ANGLE radian" << std::endl;
990 fout <<
"SOLID_ANGLE steradian" << std::endl;
991 fout <<
"MONEY US$" << std::endl;
992 fout <<
"FORCE newton" << std::endl;
993 fout <<
"PRESSURE FORCE / AREA" << std::endl;
994 fout <<
"STRESS FORCE / AREA" << std::endl;
995 fout <<
"CHARGE coulomb" << std::endl;
996 fout <<
"CAPACITANCE farad" << std::endl;
997 fout <<
"RESISTANCE ohm" << std::endl;
998 fout <<
"CONDUCTANCE siemens" << std::endl;
999 fout <<
"INDUCTANCE henry" << std::endl;
1000 fout <<
"FREQUENCY hertz" << std::endl;
1001 fout <<
"VELOCITY LENGTH / TIME" << std::endl;
1002 fout <<
"ACCELERATION VELOCITY / TIME" << std::endl;
1003 fout <<
"DENSITY MASS / VOLUME" << std::endl;
1004 fout <<
"LINEAR_DENSITY MASS / LENGTH" << std::endl;
1005 fout <<
"VISCOSITY FORCE TIME / AREA" << std::endl;
1006 fout <<
"KINEMATIC_VISCOSITY VISCOSITY / DENSITY" << std::endl;
1010 fout <<
"/ ----------------------------------------------"
1011 <<
"--------------" << std::endl;
1012 fout <<
"/ " << std::endl;
1014 fout <<
"################################################"
1015 <<
"##############" << std::endl;
1016 fout <<
"# GSL constants" << std::endl;
1019 <<
" m" << std::endl;
1020 fout <<
"Rschwarz\t\tschwarzchild_radius" << std::endl;
1021 fout <<
"speed_of_light\t\t" << sol_mks
1022 <<
" m / s" << std::endl;
1023 fout <<
"c\t\tspeed_of_light" << std::endl;
1024 fout <<
"gravitational_constant\t\t"
1026 <<
" m^3 / kg s^2" << std::endl;
1027 fout <<
"G\t\tgravitational_constant" << std::endl;
1028 fout <<
"plancks_constant_h\t\t"
1030 <<
" kg m^2 / s" << std::endl;
1031 fout <<
"h\t\tplancks_constant_h" << std::endl;
1032 fout <<
"plancks_constant_hbar\t\t"
1034 <<
" kg m^2 / s" << std::endl;
1035 fout <<
"hbar\t\tplancks_constant_hbar" << std::endl;
1037 <<
" m" << std::endl;
1038 fout <<
"au\t\tastronomical_unit" << std::endl;
1040 <<
" m" << std::endl;
1041 fout <<
"lyr\t\tlight_year" << std::endl;
1043 <<
" m" << std::endl;
1044 fout <<
"pc\t\tparsec" << std::endl;
1046 <<
" m / s^2" << std::endl;
1047 fout <<
"electron_volt\t\t" << elem_charge
1048 <<
" kg m^2 / s^2" << std::endl;
1049 fout <<
"eV\t\telectron_volt" << std::endl;
1051 <<
" kg" << std::endl;
1053 <<
" kg" << std::endl;
1055 <<
" kg" << std::endl;
1057 <<
" kg" << std::endl;
1059 <<
" kg m^2 / s^2" << std::endl;
1061 <<
" kg m^2 / K s^2" << std::endl;
1063 <<
" A m^2" << std::endl;
1065 <<
" A m^2" << std::endl;
1066 fout <<
"electron_magnetic_moment\t\t"
1068 <<
" A m^2" << std::endl;
1069 fout <<
"proton_magnetic_moment\t\t"
1071 <<
" A m^2" << std::endl;
1073 <<
" kg m^2 / K mol s^2" << std::endl;
1075 <<
" m^3 / mol" << std::endl;
1077 <<
" s" << std::endl;
1078 fout <<
"min\t\tminute" << std::endl;
1080 <<
" s" << std::endl;
1082 <<
" s" << std::endl;
1084 <<
" s" << std::endl;
1086 <<
" m" << std::endl;
1088 <<
" m" << std::endl;
1090 <<
" m" << std::endl;
1092 <<
" m" << std::endl;
1094 <<
" m" << std::endl;
1096 <<
" m" << std::endl;
1098 <<
" m" << std::endl;
1100 <<
" m" << std::endl;
1102 <<
" m" << std::endl;
1104 <<
" m" << std::endl;
1106 <<
" m" << std::endl;
1108 <<
" m^2" << std::endl;
1110 <<
" m^2" << std::endl;
1112 <<
" m^2" << std::endl;
1114 <<
" m^3" << std::endl;
1116 <<
" m^3" << std::endl;
1117 fout <<
"gallon\t\tus_gallon" << std::endl;
1119 <<
" m^3" << std::endl;
1121 <<
" m^3" << std::endl;
1123 <<
" m^3" << std::endl;
1125 <<
" m^3" << std::endl;
1127 <<
" m^3" << std::endl;
1129 <<
" m^3" << std::endl;
1131 <<
" m^3" << std::endl;
1133 <<
" m^3" << std::endl;
1135 <<
" m / s" << std::endl;
1136 fout <<
"mph\t\tmiles_per_hour" << std::endl;
1138 <<
" m / s" << std::endl;
1139 fout <<
"kph\t\tkilometers_per_hour" << std::endl;
1141 <<
" m / s" << std::endl;
1143 <<
" kg" << std::endl;
1145 <<
" kg" << std::endl;
1147 <<
" kg" << std::endl;
1149 <<
" kg" << std::endl;
1151 <<
" kg" << std::endl;
1153 <<
" kg" << std::endl;
1155 <<
" kg" << std::endl;
1157 <<
" kg" << std::endl;
1159 <<
" kg m / s^2" << std::endl;
1161 <<
" kg m / s^2" << std::endl;
1163 <<
" kg m / s^2" << std::endl;
1165 <<
" kg m / s^2" << std::endl;
1167 <<
" kg m^2 / s^2" << std::endl;
1169 <<
" kg m^2 / s^2" << std::endl;
1171 <<
" kg m^2 / s^2" << std::endl;
1173 <<
" kg m^2 / s^3" << std::endl;
1174 fout <<
"hp\t\thorsepower" << std::endl;
1176 <<
" kg / m s^2" << std::endl;
1178 <<
" kg / m s^2" << std::endl;
1180 <<
" kg / m s^2" << std::endl;
1182 <<
" kg / m s^2" << std::endl;
1184 <<
" kg / m s^2" << std::endl;
1186 <<
" kg / m s^2" << std::endl;
1188 <<
" kg / m s^2" << std::endl;
1190 <<
" kg / m s " << std::endl;
1192 <<
" m^2 / s" << std::endl;
1194 <<
" A s / mol" << std::endl;
1196 <<
" A s" << std::endl;
1198 <<
" kg / A s^2" << std::endl;
1200 <<
" cd / m^2" << std::endl;
1202 <<
" cd sr" << std::endl;
1204 <<
" cd sr / m^2" << std::endl;
1206 <<
" cd sr / m^2" << std::endl;
1208 <<
" cd sr / m^2" << std::endl;
1210 <<
" cd sr / m^2" << std::endl;
1212 <<
" cd sr / m^2" << std::endl;
1214 <<
" 1 / s" << std::endl;
1216 <<
" A s / kg" << std::endl;
1218 <<
" m^2 / s^2" << std::endl;
1220 <<
" kg" << std::endl;
1221 fout <<
"Msun\t\tsolar_mass" << std::endl;
1223 <<
" m" << std::endl;
1225 <<
" kg m / s^2" << std::endl;
1227 <<
" kg m^2 / s^2" << std::endl;
1228 fout <<
"stefan_boltzmann_constant\t\t"
1230 <<
" kg / K^4 s^3" << std::endl;
1231 fout <<
"thomson_cross_section\t\t"
1233 <<
" m^2" << std::endl;
1235 <<
" A^2 s^4 / kg m^3" << std::endl;
1237 <<
" kg m / A^2 s^2" << std::endl;
1251 for (m2=m;m2!=
mcache.end();m2++) {
1252 std::string from=m->second.f;
1253 std::string to=m2->second.t;
1255 fp_t v=1.0, c, f1, f2=0.0;
1261 if (fabs(f1-f2)/f1>1.0e-6) {
1266 std::cout.width(10);
1267 std::cout << from <<
" ";
1268 std::cout.width(10);
1269 std::cout << to <<
" " << f1 <<
" " << f2 <<
" "
1270 << fabs(f1-f2)/f1 << std::endl;
1276 fp_t v=1.0, c, f1, f2;
1282 if (fabs(f1-f2)/f1>1.0e-6) {
1287 std::cout.width(10);
1288 std::cout << from <<
" ";
1289 std::cout.width(10);
1290 std::cout << to <<
" " << f1 <<
" " << f2 <<
" "
1291 << fabs(f1-f2)/f1 << std::endl;
1303 #ifndef DOXYGEN_NO_O2NS