| 18 | | version(FullSI) |
|---|
| 19 | | { |
|---|
| 20 | | |
|---|
| 21 | | private alias T!(0,0) extra; |
|---|
| 22 | | private alias T!(0,1,0,1) extra2; |
|---|
| 23 | | |
|---|
| 24 | | template Batch( |
|---|
| 25 | | int LengthN, int LengthD, |
|---|
| 26 | | int MassN, int MassD, |
|---|
| 27 | | int TimeN, int TimeD, |
|---|
| 28 | | int TempN, int TempD, |
|---|
| 29 | | int CurrentN, int CurrentD, |
|---|
| 30 | | int LumiN, int LumiD, |
|---|
| 31 | | int MoleN, int MoleD |
|---|
| 32 | | ) |
|---|
| 33 | | { |
|---|
| 34 | | // sanity check |
|---|
| 35 | | static assert (Reduce!(LengthN, LengthD).Reduced, "Length must be in reduced form"); |
|---|
| 36 | | static assert (Reduce!(MassN, MassD).Reduced, "Mass must be in reduced form"); |
|---|
| 37 | | static assert (Reduce!(TimeN, TimeD).Reduced, "Time must be in reduced form"); |
|---|
| 38 | | static assert (Reduce!(TempN, TempD).Reduced, "Temp must be in reduced form"); |
|---|
| 39 | | static assert (Reduce!(CurrentN, CurrentD).Reduced,"Current must be in reduced form"); |
|---|
| 40 | | static assert (Reduce!(LumiN, LumiD).Reduced, "Luminous intensity must be in reduced form"); |
|---|
| 41 | | static assert (Reduce!(MoleN, MoleD).Reduced, "Quantity must be in reduced form"); |
|---|
| 42 | | |
|---|
| 43 | | /// visable units |
|---|
| 44 | | enum LenN = LengthN, LenD = LengthD; |
|---|
| 45 | | enum MasN = MassN, MasD = MassD; /// |
|---|
| 46 | | enum TimN = TimeN, TimD = TimeD; /// |
|---|
| 47 | | enum TmpN = TempN, TmpD = TempD; /// |
|---|
| 48 | | enum CurN = CurrentN, CurD = CurrentD; /// |
|---|
| 49 | | enum LumN = LumiN, LumD = LumiD; /// |
|---|
| 50 | | enum MolN = MoleN, MolD = MoleD; /// |
|---|
| 51 | | } |
|---|
| 52 | | |
|---|
| 53 | | template SI(int LengthN, int MassN, int TimeN, int TempN, int CurrentN, int LumiN, int MoleN, T = real) |
|---|
| 54 | | { |
|---|
| 55 | | alias SIB!(Batch!( |
|---|
| 56 | | /// visable units |
|---|
| 57 | | LengthN, 1, |
|---|
| 58 | | MassN, 1, |
|---|
| 59 | | TimeN, 1, |
|---|
| 60 | | TempN, 1, |
|---|
| 61 | | CurrentN, 1, |
|---|
| 62 | | LumiN, 1, |
|---|
| 63 | | MoleN, 1 |
|---|
| 64 | | ), T) SI; |
|---|
| 65 | | } |
|---|
| 66 | | template SI( |
|---|
| 67 | | int LengthN, int LengthD, |
|---|
| 68 | | int MassN, int MassD, |
|---|
| 69 | | int TimeN, int TimeD, |
|---|
| 70 | | int TempN, int TempD, |
|---|
| 71 | | int CurrentN, int CurrentD, |
|---|
| 72 | | int LuminN, int LuminD, |
|---|
| 73 | | int MoleN, int MoleD, |
|---|
| 74 | | T = real |
|---|
| 75 | | ) |
|---|
| 76 | | { |
|---|
| 77 | | alias SIB!(Batch!( |
|---|
| 78 | | /// visable units |
|---|
| 79 | | LengthN, LengthD, |
|---|
| 80 | | MassN, MassD, |
|---|
| 81 | | TimeN, TimeD, |
|---|
| 82 | | TempN, TempD, |
|---|
| 83 | | CurrentN, CurrentD, |
|---|
| 84 | | LuminN, LuminD, |
|---|
| 85 | | MoleN, MoleD |
|---|
| 86 | | ), T ) SI; |
|---|
| 87 | | } |
|---|
| | 45 | version(FullSI) /// For most cases Lumins and Moles are not needed and just add bulk |
|---|
| | 46 | { |
|---|
| | 47 | |
|---|
| | 48 | private alias T!(0,0) extra; |
|---|
| | 49 | private alias T!(0,1,0,1) extra2; |
|---|
| | 50 | |
|---|
| | 51 | template Batch( |
|---|
| | 52 | int LengthN, int LengthD, |
|---|
| | 53 | int MassN, int MassD, |
|---|
| | 54 | int TimeN, int TimeD, |
|---|
| | 55 | int TempN, int TempD, |
|---|
| | 56 | int CurrentN, int CurrentD, |
|---|
| | 57 | int LumiN, int LumiD, |
|---|
| | 58 | int MoleN, int MoleD |
|---|
| | 59 | ) |
|---|
| | 60 | { |
|---|
| | 61 | // sanity check |
|---|
| | 62 | static assert (Reduce!(LengthN, LengthD).Reduced, "Length must be in reduced form"); |
|---|
| | 63 | static assert (Reduce!(MassN, MassD).Reduced, "Mass must be in reduced form"); |
|---|
| | 64 | static assert (Reduce!(TimeN, TimeD).Reduced, "Time must be in reduced form"); |
|---|
| | 65 | static assert (Reduce!(TempN, TempD).Reduced, "Temp must be in reduced form"); |
|---|
| | 66 | static assert (Reduce!(CurrentN, CurrentD).Reduced,"Current must be in reduced form"); |
|---|
| | 67 | static assert (Reduce!(LumiN, LumiD).Reduced, "Luminous intensity must be in reduced form"); |
|---|
| | 68 | static assert (Reduce!(MoleN, MoleD).Reduced, "Quantity must be in reduced form"); |
|---|
| | 69 | |
|---|
| | 70 | /// visable units |
|---|
| | 71 | enum LenN = LengthN, LenD = LengthD; |
|---|
| | 72 | enum MasN = MassN, MasD = MassD; /// |
|---|
| | 73 | enum TimN = TimeN, TimD = TimeD; /// |
|---|
| | 74 | enum TmpN = TempN, TmpD = TempD; /// |
|---|
| | 75 | enum CurN = CurrentN, CurD = CurrentD; /// |
|---|
| | 76 | enum LumN = LumiN, LumD = LumiD; /// |
|---|
| | 77 | enum MolN = MoleN, MolD = MoleD; /// |
|---|
| | 78 | } |
|---|
| | 79 | |
|---|
| | 80 | template SI(int LengthN, int MassN, int TimeN, int TempN, int CurrentN, int LumiN, int MoleN, T = real) |
|---|
| | 81 | { |
|---|
| | 82 | alias SIB!(Batch!( |
|---|
| | 83 | /// visable units |
|---|
| | 84 | LengthN, 1, |
|---|
| | 85 | MassN, 1, |
|---|
| | 86 | TimeN, 1, |
|---|
| | 87 | TempN, 1, |
|---|
| | 88 | CurrentN, 1, |
|---|
| | 89 | LumiN, 1, |
|---|
| | 90 | MoleN, 1 |
|---|
| | 91 | ), T) SI; |
|---|
| | 92 | } |
|---|
| | 93 | template SI( |
|---|
| | 94 | int LengthN, int LengthD, |
|---|
| | 95 | int MassN, int MassD, |
|---|
| | 96 | int TimeN, int TimeD, |
|---|
| | 97 | int TempN, int TempD, |
|---|
| | 98 | int CurrentN, int CurrentD, |
|---|
| | 99 | int LuminN, int LuminD, |
|---|
| | 100 | int MoleN, int MoleD, |
|---|
| | 101 | T = real |
|---|
| | 102 | ) |
|---|
| | 103 | { |
|---|
| | 104 | alias SIB!(Batch!( |
|---|
| | 105 | /// visable units |
|---|
| | 106 | LengthN, LengthD, |
|---|
| | 107 | MassN, MassD, |
|---|
| | 108 | TimeN, TimeD, |
|---|
| | 109 | TempN, TempD, |
|---|
| | 110 | CurrentN, CurrentD, |
|---|
| | 111 | LuminN, LuminD, |
|---|
| | 112 | MoleN, MoleD |
|---|
| | 113 | ), T ) SI; |
|---|
| | 114 | } |
|---|
| 91 | | private alias T!() extra; |
|---|
| 92 | | private alias T!() extra2; |
|---|
| 93 | | template Batch( |
|---|
| 94 | | int LengthN, int LengthD, |
|---|
| 95 | | int MassN, int MassD, |
|---|
| 96 | | int TimeN, int TimeD, |
|---|
| 97 | | int TempN, int TempD, |
|---|
| 98 | | int CurrentN, int CurrentD |
|---|
| 99 | | ) |
|---|
| 100 | | { |
|---|
| 101 | | // sanity check |
|---|
| 102 | | static assert (Reduce!(LengthN, LengthD).Reduced, "Length must be in reduced form"); |
|---|
| 103 | | static assert (Reduce!(MassN, MassD).Reduced, "Mass must be in reduced form"); |
|---|
| 104 | | static assert (Reduce!(TimeN, TimeD).Reduced, "Time must be in reduced form"); |
|---|
| 105 | | static assert (Reduce!(TempN, TempD).Reduced, "Temp must be in reduced form"); |
|---|
| 106 | | static assert (Reduce!(CurrentN, CurrentD).Reduced,"Current must be in reduced form"); |
|---|
| 107 | | |
|---|
| 108 | | /// visable units |
|---|
| 109 | | enum LenN = LengthN, LenD = LengthD; |
|---|
| 110 | | enum MasN = MassN, MasD = MassD; /// |
|---|
| 111 | | enum TimN = TimeN, TimD = TimeD; /// |
|---|
| 112 | | enum TmpN = TempN, TmpD = TempD; /// |
|---|
| 113 | | enum CurN = CurrentN, CurD = CurrentD; /// |
|---|
| 114 | | } |
|---|
| 115 | | |
|---|
| 116 | | template SI(int LengthN, int MassN, int TimeN, int TempN, int CurrentN, T = real) |
|---|
| 117 | | { |
|---|
| 118 | | alias SIB!(Batch!( |
|---|
| 119 | | /// visable units |
|---|
| 120 | | LengthN, 1, |
|---|
| 121 | | MassN, 1, |
|---|
| 122 | | TimeN, 1, |
|---|
| 123 | | TempN, 1, |
|---|
| 124 | | CurrentN, 1 |
|---|
| 125 | | ), T ) SI; |
|---|
| 126 | | } |
|---|
| 127 | | template SI( |
|---|
| 128 | | int LengthN, int LengthD, |
|---|
| 129 | | int MassN, int MassD, |
|---|
| 130 | | int TimeN, int TimeD, |
|---|
| 131 | | int TempN, int TempD, |
|---|
| 132 | | int CurrentN, int CurrentD, |
|---|
| 133 | | T = real |
|---|
| 134 | | ) |
|---|
| 135 | | { |
|---|
| 136 | | |
|---|
| 137 | | alias SIB!(Batch!( |
|---|
| 138 | | /// visable units |
|---|
| 139 | | LengthN, LengthD, |
|---|
| 140 | | MassN, MassD, |
|---|
| 141 | | TimeN, TimeD, |
|---|
| 142 | | TempN, TempD, |
|---|
| 143 | | CurrentN, CurrentD |
|---|
| 144 | | ), T ) SI; |
|---|
| 145 | | } |
|---|
| 146 | | } |
|---|
| | 118 | private alias T!() extra; |
|---|
| | 119 | private alias T!() extra2; |
|---|
| | 120 | template Batch( |
|---|
| | 121 | int LengthN, int LengthD, |
|---|
| | 122 | int MassN, int MassD, |
|---|
| | 123 | int TimeN, int TimeD, |
|---|
| | 124 | int TempN, int TempD, |
|---|
| | 125 | int CurrentN, int CurrentD |
|---|
| | 126 | ) |
|---|
| | 127 | { |
|---|
| | 128 | // sanity check |
|---|
| | 129 | static assert (Reduce!(LengthN, LengthD).Reduced, "Length must be in reduced form"); |
|---|
| | 130 | static assert (Reduce!(MassN, MassD).Reduced, "Mass must be in reduced form"); |
|---|
| | 131 | static assert (Reduce!(TimeN, TimeD).Reduced, "Time must be in reduced form"); |
|---|
| | 132 | static assert (Reduce!(TempN, TempD).Reduced, "Temp must be in reduced form"); |
|---|
| | 133 | static assert (Reduce!(CurrentN, CurrentD).Reduced,"Current must be in reduced form"); |
|---|
| | 134 | |
|---|
| | 135 | /// visable units |
|---|
| | 136 | enum LenN = LengthN, LenD = LengthD; |
|---|
| | 137 | enum MasN = MassN, MasD = MassD; /// |
|---|
| | 138 | enum TimN = TimeN, TimD = TimeD; /// |
|---|
| | 139 | enum TmpN = TempN, TmpD = TempD; /// |
|---|
| | 140 | enum CurN = CurrentN, CurD = CurrentD; /// |
|---|
| | 141 | } |
|---|
| | 142 | |
|---|
| | 143 | template SI(int LengthN, int MassN, int TimeN, int TempN, int CurrentN, T = real) |
|---|
| | 144 | { |
|---|
| | 145 | alias SIB!(Batch!( |
|---|
| | 146 | /// visable units |
|---|
| | 147 | LengthN, 1, |
|---|
| | 148 | MassN, 1, |
|---|
| | 149 | TimeN, 1, |
|---|
| | 150 | TempN, 1, |
|---|
| | 151 | CurrentN, 1 |
|---|
| | 152 | ), T ) SI; |
|---|
| | 153 | } |
|---|
| | 154 | template SI( |
|---|
| | 155 | int LengthN, int LengthD, |
|---|
| | 156 | int MassN, int MassD, |
|---|
| | 157 | int TimeN, int TimeD, |
|---|
| | 158 | int TempN, int TempD, |
|---|
| | 159 | int CurrentN, int CurrentD, |
|---|
| | 160 | T = real |
|---|
| | 161 | ) |
|---|
| | 162 | { |
|---|
| | 163 | |
|---|
| | 164 | alias SIB!(Batch!( |
|---|
| | 165 | /// visable units |
|---|
| | 166 | LengthN, LengthD, |
|---|
| | 167 | MassN, MassD, |
|---|
| | 168 | TimeN, TimeD, |
|---|
| | 169 | TempN, TempD, |
|---|
| | 170 | CurrentN, CurrentD |
|---|
| | 171 | ), T ) SI; |
|---|
| | 172 | } |
|---|
| | 173 | } |
|---|
| | 174 | |
|---|
| 150 | | alias Exp_ Exp; |
|---|
| 151 | | |
|---|
| 152 | | |
|---|
| 153 | | // generate a usable name string |
|---|
| 154 | | static if(Exp.LenD == 1) private enum sLen = Exp.LenN.stringof; else private enum sLen = Exp.LenN.stringof~"/"~Exp.LenD.stringof; |
|---|
| 155 | | static if(Exp.MasD == 1) private enum sMas = Exp.MasN.stringof; else private enum sMas = Exp.MasN.stringof~"/"~Exp.MasD.stringof; |
|---|
| 156 | | static if(Exp.TimD == 1) private enum sTim = Exp.TimN.stringof; else private enum sTim = Exp.TimN.stringof~"/"~Exp.TimD.stringof; |
|---|
| 157 | | static if(Exp.TmpD == 1) private enum sTmp = Exp.TmpN.stringof; else private enum sTmp = Exp.TmpN.stringof~"/"~Exp.TmpD.stringof; |
|---|
| 158 | | static if(Exp.CurD == 1) private enum sCur = Exp.CurN.stringof; else private enum sCur = Exp.CurN.stringof~"/"~Exp.CurD.stringof; |
|---|
| 159 | | /// The type name |
|---|
| 160 | | version(FullSI) |
|---|
| 161 | | { |
|---|
| 162 | | static if(Exp.LumD == 1) private enum sLum = Exp.LumN.stringof; else private enum sLum = Exp.LumN.stringof~"/"~Exp.LumD.stringof; |
|---|
| 163 | | static if(Exp.MolD == 1) private enum sMol = Exp.MolN.stringof; else private enum sMol = Exp.MolN.stringof~"/"~Exp.MolD.stringof; |
|---|
| 164 | | public enum Stringof = "SI!("~sLen~","~sMas~","~sTim~","~sTmp~","~sCur~","~sLum~","~sMol~","~U.stringof~")"; |
|---|
| 165 | | } |
|---|
| 166 | | else public enum Stringof = "SI!("~sLen~","~sMas~","~sTim~","~sTmp~","~sCur~","~U.stringof~")"; |
|---|
| 167 | | |
|---|
| 168 | | /// the value |
|---|
| 169 | | private U value; |
|---|
| 170 | | |
|---|
| 171 | | /// a more meaningful name |
|---|
| 172 | | private alias SIB This; |
|---|
| 173 | | |
|---|
| 174 | | // check to make shure it's right! |
|---|
| 175 | | static assert(is(SIB!(Exp,U) == This)); |
|---|
| 176 | | |
|---|
| 177 | | template Using(V) { alias SIB!(Exp,V) Using; } |
|---|
| 178 | | |
|---|
| 179 | | template Alike2(V) |
|---|
| 180 | | { |
|---|
| 181 | | version(FullSI) enum bool Alike2 = |
|---|
| 182 | | Exp.LumN == V.Exp.LumN && Exp.LumD == V.Exp.LumD && |
|---|
| 183 | | Exp.MolN == V.Exp.MolN && Exp.MolD == V.Exp.MolD; |
|---|
| 184 | | else enum bool Alike2 = true; |
|---|
| 185 | | } |
|---|
| 186 | | template Alike(V) |
|---|
| 187 | | { |
|---|
| 188 | | enum bool Alike = Alike2!(V) && |
|---|
| 189 | | Exp.LenN == V.Exp.LenN && Exp.LenD == V.Exp.LenD && |
|---|
| 190 | | Exp.MasN == V.Exp.MasN && Exp.MasD == V.Exp.MasD && |
|---|
| 191 | | Exp.TimN == V.Exp.TimN && Exp.TimD == V.Exp.TimD && |
|---|
| 192 | | Exp.TmpN == V.Exp.TmpN && Exp.TmpD == V.Exp.TmpD && |
|---|
| 193 | | Exp.CurN == V.Exp.CurN && Exp.CurD == V.Exp.CurD; |
|---|
| 194 | | } |
|---|
| 195 | | |
|---|
| 196 | | |
|---|
| 197 | | /// find the type of "This * T" |
|---|
| 198 | | private template Mul2(U) |
|---|
| 199 | | { |
|---|
| 200 | | version(FullSI) alias T!( |
|---|
| 201 | | Reduce!(Exp.LumN*U.Exp.LumD + Exp.LumD*U.Exp.LumN, Exp.LumD*U.Exp.LumD).V, |
|---|
| 202 | | Reduce!(Exp.MolN*U.Exp.MolD + Exp.MolD*U.Exp.MolN, Exp.MolD*U.Exp.MolD).V) Mul2; |
|---|
| 203 | | else alias T!() Mul2; |
|---|
| 204 | | } |
|---|
| 205 | | private template Mul(T) |
|---|
| 206 | | { |
|---|
| 207 | | static if(is(T : U)) |
|---|
| 208 | | alias This Mul; |
|---|
| 209 | | else |
|---|
| 210 | | alias SIB!(Batch!( |
|---|
| 211 | | Reduce!(Exp.LenN*T.Exp.LenD + Exp.LenD*T.Exp.LenN, Exp.LenD*T.Exp.LenD).V, |
|---|
| 212 | | Reduce!(Exp.MasN*T.Exp.MasD + Exp.MasD*T.Exp.MasN, Exp.MasD*T.Exp.MasD).V, |
|---|
| 213 | | Reduce!(Exp.TimN*T.Exp.TimD + Exp.TimD*T.Exp.TimN, Exp.TimD*T.Exp.TimD).V, |
|---|
| 214 | | Reduce!(Exp.TmpN*T.Exp.TmpD + Exp.TmpD*T.Exp.TmpN, Exp.TmpD*T.Exp.TmpD).V, |
|---|
| 215 | | Reduce!(Exp.CurN*T.Exp.CurD + Exp.CurD*T.Exp.CurN, Exp.CurD*T.Exp.CurD).V, |
|---|
| 216 | | Mul2!(T)), |
|---|
| 217 | | U |
|---|
| 218 | | ) Mul; |
|---|
| 219 | | } |
|---|
| 220 | | |
|---|
| 221 | | /// find the type of "This / T" |
|---|
| 222 | | private template Div2(U) |
|---|
| 223 | | { |
|---|
| 224 | | version(FullSI) alias T!( |
|---|
| 225 | | Reduce!(Exp.LumN*U.Exp.LumD - Exp.LumD*U.Exp.LumN, Exp.LumD*U.Exp.LumD).V, |
|---|
| 226 | | Reduce!(Exp.MolN*U.Exp.MolD - Exp.MolD*U.Exp.MolN, Exp.MolD*U.Exp.MolD).V) Div2; |
|---|
| 227 | | else alias T!() Div2; |
|---|
| 228 | | } |
|---|
| 229 | | private template Div(T) |
|---|
| 230 | | { |
|---|
| 231 | | static if(is(T : U)) |
|---|
| 232 | | alias This Div; |
|---|
| 233 | | else |
|---|
| 234 | | alias SIB!(Batch!( |
|---|
| 235 | | Reduce!(Exp.LenN*T.Exp.LenD - Exp.LenD*T.Exp.LenN, Exp.LenD*T.Exp.LenD).V, |
|---|
| 236 | | Reduce!(Exp.MasN*T.Exp.MasD - Exp.MasD*T.Exp.MasN, Exp.MasD*T.Exp.MasD).V, |
|---|
| 237 | | Reduce!(Exp.TimN*T.Exp.TimD - Exp.TimD*T.Exp.TimN, Exp.TimD*T.Exp.TimD).V, |
|---|
| 238 | | Reduce!(Exp.TmpN*T.Exp.TmpD - Exp.TmpD*T.Exp.TmpN, Exp.TmpD*T.Exp.TmpD).V, |
|---|
| 239 | | Reduce!(Exp.CurN*T.Exp.CurD - Exp.CurD*T.Exp.CurN, Exp.CurD*T.Exp.CurD).V, |
|---|
| 240 | | Div2!(T)), |
|---|
| 241 | | U |
|---|
| 242 | | ) Div; |
|---|
| 243 | | } |
|---|
| 244 | | |
|---|
| 245 | | /// find the type of "This ^ 1/i" |
|---|
| 246 | | private template Root2(int i) |
|---|
| 247 | | { |
|---|
| 248 | | version(FullSI) alias T!( |
|---|
| 249 | | Reduce!(Exp.LumN,Exp.LumD*i).V, |
|---|
| 250 | | Reduce!(Exp.MolN,Exp.MolD*i).V) Root2; |
|---|
| 251 | | else alias T!() Root2; |
|---|
| 252 | | } |
|---|
| 253 | | private static template RootT(int i) |
|---|
| 254 | | { |
|---|
| 255 | | alias SIB!(Batch!( |
|---|
| 256 | | Reduce!(Exp.LenN, Exp.LenD*i).V, |
|---|
| 257 | | Reduce!(Exp.MasN, Exp.MasD*i).V, |
|---|
| 258 | | Reduce!(Exp.TimN, Exp.TimD*i).V, |
|---|
| 259 | | Reduce!(Exp.TmpN, Exp.TmpD*i).V, |
|---|
| 260 | | Reduce!(Exp.CurN, Exp.CurD*i).V, |
|---|
| 261 | | Root2!(i) |
|---|
| 262 | | ), |
|---|
| 263 | | U) RootT; |
|---|
| 264 | | } |
|---|
| 265 | | |
|---|
| 266 | | /// find the type of "This ^ i" |
|---|
| 267 | | private template Power2(int i) |
|---|
| 268 | | { |
|---|
| 269 | | version(FullSI) alias T!( |
|---|
| 270 | | Reduce!(Exp.LumN*i,Exp.LumD).V, |
|---|
| 271 | | Reduce!(Exp.MolN*i,Exp.MolD).V) Power2; |
|---|
| 272 | | else alias T!() Power2; |
|---|
| 273 | | } |
|---|
| 274 | | private template Power(int i) |
|---|
| 275 | | { |
|---|
| 276 | | alias SIB!(Batch!( |
|---|
| 277 | | Reduce!(Exp.LenN*i, Exp.LenD).V, |
|---|
| 278 | | Reduce!(Exp.MasN*i, Exp.MasD).V, |
|---|
| 279 | | Reduce!(Exp.TimN*i, Exp.TimD).V, |
|---|
| 280 | | Reduce!(Exp.TmpN*i, Exp.TmpD).V, |
|---|
| 281 | | Reduce!(Exp.CurN*i, Exp.CurD).V, |
|---|
| 282 | | Power2!(i) |
|---|
| 283 | | ), |
|---|
| 284 | | U) Power; |
|---|
| 285 | | } |
|---|
| 286 | | |
|---|
| 287 | | // I don't think I need this anymore |
|---|
| 288 | | //This opCall(This ret) { return ret; } |
|---|
| 289 | | |
|---|
| 290 | | |
|---|
| 291 | | private this(U u) { value = u; } |
|---|
| 292 | | |
|---|
| 293 | | int opCmp(This that) |
|---|
| 294 | | { |
|---|
| 295 | | if(this.value < that.value) return -1; |
|---|
| 296 | | if(this.value > that.value) return +1; |
|---|
| 297 | | return 0; |
|---|
| 298 | | } |
|---|
| 299 | | |
|---|
| 300 | | int opCmp(U that) |
|---|
| 301 | | { |
|---|
| 302 | | if(this.value < that) return -1; |
|---|
| 303 | | if(this.value > that) return +1; |
|---|
| 304 | | return 0; |
|---|
| 305 | | } |
|---|
| 306 | | |
|---|
| 307 | | /// Homomorphic math operators |
|---|
| 308 | | This opNeg() { return This(- this.value);} |
|---|
| 309 | | This opPos() { return this; } /// |
|---|
| 310 | | |
|---|
| 311 | | This opAdd(This that) { return This(this.value + that.value);} /// |
|---|
| 312 | | This opSub(This that) { return This(this.value - that.value);} /// |
|---|
| 313 | | This opAddAssign(This that) { this.value += that.value; return this; } /// |
|---|
| 314 | | This opSubAssign(This that) { this.value -= that.value; return this; } /// |
|---|
| 315 | | |
|---|
| 316 | | This opMulAssign(U r) { this.value *= r; return this; } |
|---|
| 317 | | This opDivAssign(U r) { this.value /= r; return this; } /// |
|---|
| 318 | | |
|---|
| 319 | | This opMul_r(U that) { return This(this.value * that); } /// |
|---|
| 320 | | |
|---|
| 321 | | /// non-Homomorphic math operators |
|---|
| 322 | | auto opDiv_r(U that) { return Power!(-1)(that / this.value); } /// |
|---|
| 323 | | |
|---|
| 324 | | version(FullSI) private enum unitless2 = Exp.LumN == 0 && Exp.MolN == 0; |
|---|
| 325 | | else private enum unitless2 = true; |
|---|
| 326 | | static if(Exp.LenN == 0 && Exp.MasN == 0 && Exp.TimN == 0 && Exp.TmpN == 0 && Exp.CurN == 0 && unitless2) |
|---|
| 327 | | alias value this; |
|---|
| 328 | | else |
|---|
| 329 | | { |
|---|
| 330 | | // these conflict if the "alias value this" is in effect |
|---|
| 331 | | |
|---|
| 332 | | /// non-Homomorphic math operators |
|---|
| 333 | | auto opMul(T)(T that) |
|---|
| 334 | | { |
|---|
| 335 | | static if(is(T : U)) return Mul!(T)(this.value * that); |
|---|
| 336 | | else return Mul!(T)(this.value * that.value); |
|---|
| 337 | | } |
|---|
| 338 | | auto opDiv(T)(T that) /// |
|---|
| 339 | | { |
|---|
| 340 | | static if(is(T : U)) return Div!(T)(this.value / that); |
|---|
| 341 | | else return Div!(T)(this.value / that.value); |
|---|
| 342 | | } |
|---|
| 343 | | } |
|---|
| 344 | | |
|---|
| 345 | | /// test if these are close enough |
|---|
| 346 | | bool Near(This that, int count = 5) |
|---|
| 347 | | { |
|---|
| 348 | | static if(isFloatingPoint!(U)) |
|---|
| 349 | | return std.math.feqrel!(U)(this.value,that.value) + count >= U.mant_dig; |
|---|
| 350 | | else |
|---|
| 351 | | return this.value == that.value; |
|---|
| 352 | | } |
|---|
| 353 | | |
|---|
| 354 | | /// common math functions |
|---|
| 355 | | auto Root(int i)(){return RootT!(i)(std.math.sqrt(this.value));} |
|---|
| 356 | | auto Pow(int i)(){return Power!(i)(std.math.pow(this.value,i));} /// |
|---|
| 357 | | This Abs() { return This(std.math.abs(this.value)); } /// |
|---|
| 358 | | |
|---|
| 359 | | |
|---|
| 360 | | /// convert to real from type "s" |
|---|
| 361 | | U opDispatch(string s)() |
|---|
| 362 | | { |
|---|
| 363 | | static if(!is(Unit!(s).type)) static assert(false, "SI has no member named "~s~" nor is it a known type"); |
|---|
| 364 | | else |
|---|
| 365 | | { |
|---|
| 366 | | static assert(This.Alike!(Unit!(s).type), "Can't convert type "~This.Stringof~" to \""~s~"\" of type "~Unit!(s).type.Stringof); |
|---|
| 367 | | return value / Unit!(s).mul; |
|---|
| 368 | | } |
|---|
| 369 | | } |
|---|
| | 178 | alias Exp_ Exp; |
|---|
| | 179 | |
|---|
| | 180 | |
|---|
| | 181 | // generate a usable name string |
|---|
| | 182 | static if(Exp.LenD == 1) private enum sLen = Exp.LenN.stringof; else private enum sLen = Exp.LenN.stringof~"/"~Exp.LenD.stringof; |
|---|
| | 183 | static if(Exp.MasD == 1) private enum sMas = Exp.MasN.stringof; else private enum sMas = Exp.MasN.stringof~"/"~Exp.MasD.stringof; |
|---|
| | 184 | static if(Exp.TimD == 1) private enum sTim = Exp.TimN.stringof; else private enum sTim = Exp.TimN.stringof~"/"~Exp.TimD.stringof; |
|---|
| | 185 | static if(Exp.TmpD == 1) private enum sTmp = Exp.TmpN.stringof; else private enum sTmp = Exp.TmpN.stringof~"/"~Exp.TmpD.stringof; |
|---|
| | 186 | static if(Exp.CurD == 1) private enum sCur = Exp.CurN.stringof; else private enum sCur = Exp.CurN.stringof~"/"~Exp.CurD.stringof; |
|---|
| | 187 | /// The type name |
|---|
| | 188 | version(FullSI) |
|---|
| | 189 | { |
|---|
| | 190 | static if(Exp.LumD == 1) private enum sLum = Exp.LumN.stringof; else private enum sLum = Exp.LumN.stringof~"/"~Exp.LumD.stringof; |
|---|
| | 191 | static if(Exp.MolD == 1) private enum sMol = Exp.MolN.stringof; else private enum sMol = Exp.MolN.stringof~"/"~Exp.MolD.stringof; |
|---|
| | 192 | public enum Stringof = "SI!("~sLen~","~sMas~","~sTim~","~sTmp~","~sCur~","~sLum~","~sMol~","~U.stringof~")"; |
|---|
| | 193 | } |
|---|
| | 194 | else public enum Stringof = "SI!("~sLen~","~sMas~","~sTim~","~sTmp~","~sCur~","~U.stringof~")"; |
|---|
| | 195 | |
|---|
| | 196 | /// the value |
|---|
| | 197 | private U value; |
|---|
| | 198 | |
|---|
| | 199 | /// a more meaningful name |
|---|
| | 200 | private alias SIB This; |
|---|
| | 201 | |
|---|
| | 202 | // check to make shure it's right! |
|---|
| | 203 | static assert(is(SIB!(Exp,U) == This)); |
|---|
| | 204 | |
|---|
| | 205 | template Using(V) { alias SIB!(Exp,V) Using; } |
|---|
| | 206 | |
|---|
| | 207 | template Alike2(V) |
|---|
| | 208 | { |
|---|
| | 209 | version(FullSI) enum bool Alike2 = |
|---|
| | 210 | Exp.LumN == V.Exp.LumN && Exp.LumD == V.Exp.LumD && |
|---|
| | 211 | Exp.MolN == V.Exp.MolN && Exp.MolD == V.Exp.MolD; |
|---|
| | 212 | else enum bool Alike2 = true; |
|---|
| | 213 | } |
|---|
| | 214 | template Alike(V) |
|---|
| | 215 | { |
|---|
| | 216 | enum bool Alike = Alike2!(V) && |
|---|
| | 217 | Exp.LenN == V.Exp.LenN && Exp.LenD == V.Exp.LenD && |
|---|
| | 218 | Exp.MasN == V.Exp.MasN && Exp.MasD == V.Exp.MasD && |
|---|
| | 219 | Exp.TimN == V.Exp.TimN && Exp.TimD == V.Exp.TimD && |
|---|
| | 220 | Exp.TmpN == V.Exp.TmpN && Exp.TmpD == V.Exp.TmpD && |
|---|
| | 221 | Exp.CurN == V.Exp.CurN && Exp.CurD == V.Exp.CurD; |
|---|
| | 222 | } |
|---|
| | 223 | |
|---|
| | 224 | |
|---|
| | 225 | /// find the type of "This * T" |
|---|
| | 226 | private template Mul2(U) |
|---|
| | 227 | { |
|---|
| | 228 | version(FullSI) alias T!( |
|---|
| | 229 | Reduce!(Exp.LumN*U.Exp.LumD + Exp.LumD*U.Exp.LumN, Exp.LumD*U.Exp.LumD).V, |
|---|
| | 230 | Reduce!(Exp.MolN*U.Exp.MolD + Exp.MolD*U.Exp.MolN, Exp.MolD*U.Exp.MolD).V) Mul2; |
|---|
| | 231 | else alias T!() Mul2; |
|---|
| | 232 | } |
|---|
| | 233 | private template Mul(T) |
|---|
| | 234 | { |
|---|
| | 235 | static if(is(T : U)) |
|---|
| | 236 | alias This Mul; |
|---|
| | 237 | else |
|---|
| | 238 | alias SIB!(Batch!( |
|---|
| | 239 | Reduce!(Exp.LenN*T.Exp.LenD + Exp.LenD*T.Exp.LenN, Exp.LenD*T.Exp.LenD).V, |
|---|
| | 240 | Reduce!(Exp.MasN*T.Exp.MasD + Exp.MasD*T.Exp.MasN, Exp.MasD*T.Exp.MasD).V, |
|---|
| | 241 | Reduce!(Exp.TimN*T.Exp.TimD + Exp.TimD*T.Exp.TimN, Exp.TimD*T.Exp.TimD).V, |
|---|
| | 242 | Reduce!(Exp.TmpN*T.Exp.TmpD + Exp.TmpD*T.Exp.TmpN, Exp.TmpD*T.Exp.TmpD).V, |
|---|
| | 243 | Reduce!(Exp.CurN*T.Exp.CurD + Exp.CurD*T.Exp.CurN, Exp.CurD*T.Exp.CurD).V, |
|---|
| | 244 | Mul2!(T)), |
|---|
| | 245 | U |
|---|
| | 246 | ) Mul; |
|---|
| | 247 | } |
|---|
| | 248 | |
|---|
| | 249 | /// find the type of "This / T" |
|---|
| | 250 | private template Div2(U) |
|---|
| | 251 | { |
|---|
| | 252 | version(FullSI) alias T!( |
|---|
| | 253 | Reduce!(Exp.LumN*U.Exp.LumD - Exp.LumD*U.Exp.LumN, Exp.LumD*U.Exp.LumD).V, |
|---|
| | 254 | Reduce!(Exp.MolN*U.Exp.MolD - Exp.MolD*U.Exp.MolN, Exp.MolD*U.Exp.MolD).V) Div2; |
|---|
| | 255 | else alias T!() Div2; |
|---|
| | 256 | } |
|---|
| | 257 | private template Div(T) |
|---|
| | 258 | { |
|---|
| | 259 | static if(is(T : U)) |
|---|
| | 260 | alias This Div; |
|---|
| | 261 | else |
|---|
| | 262 | alias SIB!(Batch!( |
|---|
| | 263 | Reduce!(Exp.LenN*T.Exp.LenD - Exp.LenD*T.Exp.LenN, Exp.LenD*T.Exp.LenD).V, |
|---|
| | 264 | Reduce!(Exp.MasN*T.Exp.MasD - Exp.MasD*T.Exp.MasN, Exp.MasD*T.Exp.MasD).V, |
|---|
| | 265 | Reduce!(Exp.TimN*T.Exp.TimD - Exp.TimD*T.Exp.TimN, Exp.TimD*T.Exp.TimD).V, |
|---|
| | 266 | Reduce!(Exp.TmpN*T.Exp.TmpD - Exp.TmpD*T.Exp.TmpN, Exp.TmpD*T.Exp.TmpD).V, |
|---|
| | 267 | Reduce!(Exp.CurN*T.Exp.CurD - Exp.CurD*T.Exp.CurN, Exp.CurD*T.Exp.CurD).V, |
|---|
| | 268 | Div2!(T)), |
|---|
| | 269 | U |
|---|
| | 270 | ) Div; |
|---|
| | 271 | } |
|---|
| | 272 | |
|---|
| | 273 | /// find the type of "This ^ 1/i" |
|---|
| | 274 | private template Root2(int i) |
|---|
| | 275 | { |
|---|
| | 276 | version(FullSI) alias T!( |
|---|
| | 277 | Reduce!(Exp.LumN,Exp.LumD*i).V, |
|---|
| | 278 | Reduce!(Exp.MolN,Exp.MolD*i).V) Root2; |
|---|
| | 279 | else alias T!() Root2; |
|---|
| | 280 | } |
|---|
| | 281 | private static template RootT(int i) |
|---|
| | 282 | { |
|---|
| | 283 | alias SIB!(Batch!( |
|---|
| | 284 | Reduce!(Exp.LenN, Exp.LenD*i).V, |
|---|
| | 285 | Reduce!(Exp.MasN, Exp.MasD*i).V, |
|---|
| | 286 | Reduce!(Exp.TimN, Exp.TimD*i).V, |
|---|
| | 287 | Reduce!(Exp.TmpN, Exp.TmpD*i).V, |
|---|
| | 288 | Reduce!(Exp.CurN, Exp.CurD*i).V, |
|---|
| | 289 | Root2!(i) |
|---|
| | 290 | ), |
|---|
| | 291 | U) RootT; |
|---|
| | 292 | } |
|---|
| | 293 | |
|---|
| | 294 | /// find the type of "This ^ i" |
|---|
| | 295 | private template Power2(int i) |
|---|
| | 296 | { |
|---|
| | 297 | version(FullSI) alias T!( |
|---|
| | 298 | Reduce!(Exp.LumN*i,Exp.LumD).V, |
|---|
| | 299 | Reduce!(Exp.MolN*i,Exp.MolD).V) Power2; |
|---|
| | 300 | else alias T!() Power2; |
|---|
| | 301 | } |
|---|
| | 302 | private template Power(int i) |
|---|
| | 303 | { |
|---|
| | 304 | alias SIB!(Batch!( |
|---|
| | 305 | Reduce!(Exp.LenN*i, Exp.LenD).V, |
|---|
| | 306 | Reduce!(Exp.MasN*i, Exp.MasD).V, |
|---|
| | 307 | Reduce!(Exp.TimN*i, Exp.TimD).V, |
|---|
| | 308 | Reduce!(Exp.TmpN*i, Exp.TmpD).V, |
|---|
| | 309 | Reduce!(Exp.CurN*i, Exp.CurD).V, |
|---|
| | 310 | Power2!(i) |
|---|
| | 311 | ), |
|---|
| | 312 | U) Power; |
|---|
| | 313 | } |
|---|
| | 314 | |
|---|
| | 315 | // I don't think I need this anymore |
|---|
| | 316 | //This opCall(This ret) { return ret; } |
|---|
| | 317 | |
|---|
| | 318 | |
|---|
| | 319 | private this(U u) { value = u; } |
|---|
| | 320 | |
|---|
| | 321 | int opCmp(This that) |
|---|
| | 322 | { |
|---|
| | 323 | if(this.value < that.value) return -1; |
|---|
| | 324 | if(this.value > that.value) return +1; |
|---|
| | 325 | return 0; |
|---|
| | 326 | } |
|---|
| | 327 | |
|---|
| | 328 | int opCmp(U that) |
|---|
| | 329 | { |
|---|
| | 330 | if(this.value < that) return -1; |
|---|
| | 331 | if(this.value > that) return +1; |
|---|
| | 332 | return 0; |
|---|
| | 333 | } |
|---|
| | 334 | |
|---|
| | 335 | /// Homomorphic math operators |
|---|
| | 336 | This opNeg() { return This(- this.value);} |
|---|
| | 337 | This opPos() { return this; } /// |
|---|
| | 338 | |
|---|
| | 339 | This opAdd(This that) { return This(this.value + that.value);} /// |
|---|
| | 340 | This opSub(This that) { return This(this.value - that.value);} /// |
|---|
| | 341 | This opAddAssign(This that) { this.value += that.value; return this; } /// |
|---|
| | 342 | This opSubAssign(This that) { this.value -= that.value; return this; } /// |
|---|
| | 343 | |
|---|
| | 344 | This opMulAssign(U r) { this.value *= r; return this; } |
|---|
| | 345 | This opDivAssign(U r) { this.value /= r; return this; } /// |
|---|
| | 346 | |
|---|
| | 347 | This opMul_r(U that) { return This(this.value * that); } /// |
|---|
| | 348 | |
|---|
| | 349 | /// non-Homomorphic math operators |
|---|
| | 350 | auto opDiv_r(U that) { return Power!(-1)(that / this.value); } /// |
|---|
| | 351 | |
|---|
| | 352 | version(FullSI) private enum unitless2 = Exp.LumN == 0 && Exp.MolN == 0; |
|---|
| | 353 | else private enum unitless2 = true; |
|---|
| | 354 | static if(Exp.LenN == 0 && Exp.MasN == 0 && Exp.TimN == 0 && Exp.TmpN == 0 && Exp.CurN == 0 && unitless2) |
|---|
| | 355 | alias value this; |
|---|
| | 356 | else |
|---|
| | 357 | { |
|---|
| | 358 | // these conflict if the "alias value this" is in effect |
|---|
| | 359 | |
|---|
| | 360 | /// non-Homomorphic math operators |
|---|
| | 361 | auto opMul(T)(T that) |
|---|
| | 362 | { |
|---|
| | 363 | static if(is(T : U)) return Mul!(T)(this.value * that); |
|---|
| | 364 | else return Mul!(T)(this.value * that.value); |
|---|
| | 365 | } |
|---|
| | 366 | auto opDiv(T)(T that) /// |
|---|
| | 367 | { |
|---|
| | 368 | static if(is(T : U)) return Div!(T)(this.value / that); |
|---|
| | 369 | else return Div!(T)(this.value / that.value); |
|---|
| | 370 | } |
|---|
| | 371 | } |
|---|
| | 372 | |
|---|
| | 373 | /// test if these are close enough |
|---|
| | 374 | bool Near(This that, int count = 5) |
|---|
| | 375 | { |
|---|
| | 376 | static if(isFloatingPoint!(U)) |
|---|
| | 377 | return std.math.feqrel!(U)(this.value,that.value) + count >= U.mant_dig; |
|---|
| | 378 | else |
|---|
| | 379 | return this.value == that.value; |
|---|
| | 380 | } |
|---|
| | 381 | |
|---|
| | 382 | /// common math functions |
|---|
| | 383 | auto Root(int i)(){return RootT!(i)(std.math.sqrt(this.value));} |
|---|
| | 384 | auto Pow(int i)(){return Power!(i)(std.math.pow(this.value,i));} /// |
|---|
| | 385 | This Abs() { return This(std.math.abs(this.value)); } /// |
|---|
| | 386 | |
|---|
| | 387 | |
|---|
| | 388 | /// convert to real from type "s" |
|---|
| | 389 | U opDispatch(string s)() |
|---|
| | 390 | { |
|---|
| | 391 | static if(!is(Unit!(s).type)) static assert(false, "SI has no member named "~s~" nor is it a known type"); |
|---|
| | 392 | else |
|---|
| | 393 | { |
|---|
| | 394 | static assert(This.Alike!(Unit!(s).type), "Can't convert type "~This.Stringof~" to \""~s~"\" of type "~Unit!(s).type.Stringof); |
|---|
| | 395 | return value / Unit!(s).mul; |
|---|
| | 396 | } |
|---|
| | 397 | } |
|---|
| 387 | | alias SI!( 0, 0, 0, 0, 0, extra) Value; /// |
|---|
| 388 | | alias SI!( 1, 0, 0, 0, 0, extra) Distance; /// |
|---|
| 389 | | alias SI!( 0, 1, 0, 0, 0, extra) Mass; /// |
|---|
| 390 | | alias SI!( 0, 0, 1, 0, 0, extra) Time; /// |
|---|
| 391 | | alias SI!( 0, 0, 0, 1, 0, extra) Temp; /// |
|---|
| 392 | | alias SI!( 0, 0, 0, 0, 1, extra) Current; /// |
|---|
| 393 | | version(FullSI) |
|---|
| 394 | | { |
|---|
| 395 | | alias SI!( 0, 0, 0, 0, 0, 1, 0) Luminosity; /// |
|---|
| 396 | | alias SI!( 0, 0, 0, 0, 0, 0, 1) Quantity; /// |
|---|
| 397 | | } |
|---|
| 398 | | |
|---|
| 399 | | alias SI!(-3, 1, 0, 0, 0, extra) MassDensity; /// |
|---|
| 400 | | |
|---|
| 401 | | alias SI!(-2,-1, 3, 0, 2, extra) Resistance; /// |
|---|
| 402 | | alias SI!(-2,-1, 4, 0, 2, extra) Capacitance; /// |
|---|
| 403 | | |
|---|
| 404 | | alias SI!(-1, 1,-2, 0, 0, extra) Pressure; /// |
|---|
| 405 | | alias SI!(-1, 1,-1, 0, 0, extra) Viscosity; /// |
|---|
| 406 | | |
|---|
| 407 | | alias SI!( 0, 0,-1, 0, 0, extra) Frequency; /// |
|---|
| 408 | | alias SI!( 0, 0, 1, 0, 1, extra) Charge; /// |
|---|
| 409 | | alias SI!( 0, 1,-1, 0, 0, extra) MassFlow; /// |
|---|
| 410 | | alias SI!( 0, 1,-2, 0,-1, extra) MagneticFluxD; /// |
|---|
| 411 | | |
|---|
| 412 | | alias SI!( 1, 1,-2, 0, 0, extra) Force; /// |
|---|
| 413 | | alias SI!( 1, 0,-2, 0, 0, extra) Acceleration; /// |
|---|
| 414 | | alias SI!( 1, 0,-1, 0, 0, extra) Speed; /// |
|---|
| 415 | | |
|---|
| 416 | | |
|---|
| 417 | | alias SI!( 2, 1,-3, 0,-1, extra) Voltage; /// |
|---|
| 418 | | alias SI!( 2, 1,-3, 0, 0, extra) Power; /// |
|---|
| 419 | | alias SI!( 2, 1,-2, 0,-2, extra) Inductance; /// |
|---|
| 420 | | alias SI!( 2, 1,-2, 0, 0, extra) Energy; /// |
|---|
| 421 | | alias SI!( 2, 0, 0, 0, 0, extra) Area; /// |
|---|
| 422 | | alias SI!( 2, 0,-1, 0, 0, extra) KViscosity; /// |
|---|
| 423 | | |
|---|
| 424 | | alias SI!( 3, 0,-1, 0, 0, extra) VolumeFlow; /// |
|---|
| 425 | | alias SI!( 3, 0, 0, 0, 0, extra) Volume; /// |
|---|
| | 415 | alias SI!( 0, 0, 0, 0, 0, extra) Value; /// |
|---|
| | 416 | alias SI!( 1, 0, 0, 0, 0, extra) Distance; /// |
|---|
| | 417 | alias SI!( 0, 1, 0, 0, 0, extra) Mass; /// |
|---|
| | 418 | alias SI!( 0, 0, 1, 0, 0, extra) Time; /// |
|---|
| | 419 | alias SI!( 0, 0, 0, 1, 0, extra) Temp; /// |
|---|
| | 420 | alias SI!( 0, 0, 0, 0, 1, extra) Current; /// |
|---|
| | 421 | version(FullSI) |
|---|
| | 422 | { |
|---|
| | 423 | alias SI!( 0, 0, 0, 0, 0, 1, 0) Luminosity; /// |
|---|
| | 424 | alias SI!( 0, 0, 0, 0, 0, 0, 1) Quantity; /// |
|---|
| | 425 | } |
|---|
| | 426 | |
|---|
| | 427 | alias SI!(-3, 1, 0, 0, 0, extra) MassDensity; /// |
|---|
| | 428 | |
|---|
| | 429 | alias SI!(-2,-1, 3, 0, 2, extra) Resistance; /// |
|---|
| | 430 | alias SI!(-2,-1, 4, 0, 2, extra) Capacitance; /// |
|---|
| | 431 | |
|---|
| | 432 | alias SI!(-1, 1,-2, 0, 0, extra) Pressure; /// |
|---|
| | 433 | alias SI!(-1, 1,-1, 0, 0, extra) Viscosity; /// |
|---|
| | 434 | |
|---|
| | 435 | alias SI!( 0, 0,-1, 0, 0, extra) Frequency; /// |
|---|
| | 436 | alias SI!( 0, 0, 1, 0, 1, extra) Charge; /// |
|---|
| | 437 | alias SI!( 0, 1,-1, 0, 0, extra) MassFlow; /// |
|---|
| | 438 | alias SI!( 0, 1,-2, 0,-1, extra) MagneticFluxD; /// |
|---|
| | 439 | |
|---|
| | 440 | alias SI!( 1, 1,-2, 0, 0, extra) Force; /// |
|---|
| | 441 | alias SI!( 1, 0,-2, 0, 0, extra) Acceleration; /// |
|---|
| | 442 | alias SI!( 1, 0,-1, 0, 0, extra) Speed; /// |
|---|
| | 443 | |
|---|
| | 444 | |
|---|
| | 445 | alias SI!( 2, 1,-3, 0,-1, extra) Voltage; /// |
|---|
| | 446 | alias SI!( 2, 1,-3, 0, 0, extra) Power; /// |
|---|
| | 447 | alias SI!( 2, 1,-2, 0,-2, extra) Inductance; /// |
|---|
| | 448 | alias SI!( 2, 1,-2, 0, 0, extra) Energy; /// |
|---|
| | 449 | alias SI!( 2, 0, 0, 0, 0, extra) Area; /// |
|---|
| | 450 | alias SI!( 2, 0,-1, 0, 0, extra) KViscosity; /// |
|---|
| | 451 | |
|---|
| | 452 | alias SI!( 3, 0,-1, 0, 0, extra) VolumeFlow; /// |
|---|
| | 453 | alias SI!( 3, 0, 0, 0, 0, extra) Volume; /// |
|---|