1 package org.djunits.value.vfloat.matrix;
2
3 import org.djunits.unit.AbsorbedDoseUnit;
4 import org.djunits.unit.AccelerationUnit;
5 import org.djunits.unit.AmountOfSubstanceUnit;
6 import org.djunits.unit.AngleUnit;
7 import org.djunits.unit.AngularAccelerationUnit;
8 import org.djunits.unit.AngularVelocityUnit;
9 import org.djunits.unit.AreaUnit;
10 import org.djunits.unit.CatalyticActivityUnit;
11 import org.djunits.unit.DensityUnit;
12 import org.djunits.unit.DimensionlessUnit;
13 import org.djunits.unit.DurationUnit;
14 import org.djunits.unit.ElectricalCapacitanceUnit;
15 import org.djunits.unit.ElectricalChargeUnit;
16 import org.djunits.unit.ElectricalConductanceUnit;
17 import org.djunits.unit.ElectricalCurrentUnit;
18 import org.djunits.unit.ElectricalInductanceUnit;
19 import org.djunits.unit.ElectricalPotentialUnit;
20 import org.djunits.unit.ElectricalResistanceUnit;
21 import org.djunits.unit.EnergyUnit;
22 import org.djunits.unit.EquivalentDoseUnit;
23 import org.djunits.unit.FlowMassUnit;
24 import org.djunits.unit.FlowVolumeUnit;
25 import org.djunits.unit.ForceUnit;
26 import org.djunits.unit.FrequencyUnit;
27 import org.djunits.unit.IlluminanceUnit;
28 import org.djunits.unit.LengthUnit;
29 import org.djunits.unit.LinearDensityUnit;
30 import org.djunits.unit.LuminousFluxUnit;
31 import org.djunits.unit.LuminousIntensityUnit;
32 import org.djunits.unit.MagneticFluxDensityUnit;
33 import org.djunits.unit.MagneticFluxUnit;
34 import org.djunits.unit.MassUnit;
35 import org.djunits.unit.MomentumUnit;
36 import org.djunits.unit.PowerUnit;
37 import org.djunits.unit.PressureUnit;
38 import org.djunits.unit.RadioActivityUnit;
39 import org.djunits.unit.SIUnit;
40 import org.djunits.unit.SolidAngleUnit;
41 import org.djunits.unit.SpeedUnit;
42 import org.djunits.unit.TemperatureUnit;
43 import org.djunits.unit.TorqueUnit;
44 import org.djunits.unit.Unit;
45 import org.djunits.unit.VolumeUnit;
46 import org.djunits.unit.si.SIDimensions;
47 import org.djunits.unit.util.UnitRuntimeException;
48 import org.djunits.value.ValueRuntimeException;
49 import org.djunits.value.storage.StorageType;
50 import org.djunits.value.vfloat.matrix.base.FloatMatrixRel;
51 import org.djunits.value.vfloat.matrix.data.FloatMatrixData;
52 import org.djunits.value.vfloat.scalar.FloatSIScalar;
53 import org.djunits.value.vfloat.vector.FloatSIVector;
54 import org.djunits.value.vfloat.vector.data.FloatVectorData;
55 import org.djutils.exceptions.Throw;
56
57 import jakarta.annotation.Generated;
58
59
60
61
62
63
64
65
66
67
68
69 @Generated(value = "org.djunits.generator.GenerateDJUNIT", date = "2023-07-23T14:06:38.224104100Z")
70 public class FloatSIMatrix extends FloatMatrixRel<SIUnit, FloatSIScalar, FloatSIVector, FloatSIMatrix>
71 {
72
73 private static final long serialVersionUID = 20150901L;
74
75
76
77
78
79
80 public FloatSIMatrix(final FloatMatrixData data, final SIUnit displayUnit)
81 {
82 super(data, displayUnit);
83 }
84
85
86
87
88
89
90
91
92 public FloatSIMatrix(final float[][] values, final SIUnit unit, final StorageType storageType) throws ValueRuntimeException
93 {
94 this(FloatMatrixData.instantiate(values, unit.getScale(), storageType), unit);
95 }
96
97
98
99
100
101
102
103
104 public FloatSIMatrix(final float[][] values, final SIUnit unit) throws ValueRuntimeException
105 {
106 this(values, unit, StorageType.DENSE);
107 }
108
109 @Override
110 public Class<FloatSIScalar> getScalarClass()
111 {
112 return FloatSIScalar.class;
113 }
114
115 @Override
116 public Class<FloatSIVector> getVectorClass()
117 {
118 return FloatSIVector.class;
119 }
120
121
122
123
124
125
126
127
128
129
130 public static FloatSIMatrix of(final float[][] values, final String unitString, final StorageType storageType)
131 {
132 Throw.whenNull(values, "Error parsing FloatSIMatrix: value is null");
133 Throw.whenNull(unitString, "Error parsing FloatSIMatrix: unitString is null");
134 Throw.whenNull(storageType, "Error parsing FloatSIMatrix: storageType is null");
135 try
136 {
137 SIUnit unit = Unit.lookupOrCreateUnitWithSIDimensions(SIDimensions.of(unitString));
138 if (unit != null)
139 {
140 return new FloatSIMatrix(values, unit, storageType);
141 }
142 }
143 catch (Exception exception)
144 {
145 throw new IllegalArgumentException("Error parsing SIUnit from " + unitString, exception);
146 }
147 throw new IllegalArgumentException("Error parsing FloatSIMatrix with unit " + unitString);
148 }
149
150 @Override
151 public FloatSIMatrix instantiateMatrix(final FloatMatrixData fmd, final SIUnit unit)
152 {
153 return new FloatSIMatrix(fmd, unit);
154 }
155
156 @Override
157 public FloatSIVector instantiateVector(final FloatVectorData fvd, final SIUnit unit)
158 {
159 return new FloatSIVector(fvd, unit);
160 }
161
162 @Override
163 public FloatSIScalar instantiateScalarSI(final float valueSI, final SIUnit unit)
164 {
165 return new FloatSIScalar(valueSI, unit);
166 }
167
168 @Override
169 public String toString(final SIUnit displayUnit, final boolean verbose, final boolean withUnit)
170 {
171 return super.toString(displayUnit, verbose, withUnit).replaceAll("!", "");
172 }
173
174
175
176
177
178
179
180
181
182 public final FloatAbsorbedDoseMatrix asAbsorbedDose()
183 {
184 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AbsorbedDoseUnit.BASE.getSiDimensions())),
185 UnitRuntimeException.class, "cannot cast %s to FloatAbsorbedDoseMatrix", this.toString());
186 return new FloatAbsorbedDoseMatrix(this.data, AbsorbedDoseUnit.SI);
187 }
188
189
190
191
192
193
194 public final FloatAbsorbedDoseMatrix asAbsorbedDose(final AbsorbedDoseUnit displayUnit)
195 {
196 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AbsorbedDoseUnit.BASE.getSiDimensions())),
197 UnitRuntimeException.class, "cannot cast %s to FloatAbsorbedDoseMatrix", this.toString());
198 FloatAbsorbedDoseMatrix result = new FloatAbsorbedDoseMatrix(this.data, displayUnit.getStandardUnit());
199 result.setDisplayUnit(displayUnit);
200 return result;
201 }
202
203
204
205
206
207 public final FloatAccelerationMatrix asAcceleration()
208 {
209 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AccelerationUnit.BASE.getSiDimensions())),
210 UnitRuntimeException.class, "cannot cast %s to FloatAccelerationMatrix", this.toString());
211 return new FloatAccelerationMatrix(this.data, AccelerationUnit.SI);
212 }
213
214
215
216
217
218
219 public final FloatAccelerationMatrix asAcceleration(final AccelerationUnit displayUnit)
220 {
221 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AccelerationUnit.BASE.getSiDimensions())),
222 UnitRuntimeException.class, "cannot cast %s to FloatAccelerationMatrix", this.toString());
223 FloatAccelerationMatrix result = new FloatAccelerationMatrix(this.data, displayUnit.getStandardUnit());
224 result.setDisplayUnit(displayUnit);
225 return result;
226 }
227
228
229
230
231
232 public final FloatAmountOfSubstanceMatrix asAmountOfSubstance()
233 {
234 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AmountOfSubstanceUnit.BASE.getSiDimensions())),
235 UnitRuntimeException.class, "cannot cast %s to FloatAmountOfSubstanceMatrix", this.toString());
236 return new FloatAmountOfSubstanceMatrix(this.data, AmountOfSubstanceUnit.SI);
237 }
238
239
240
241
242
243
244 public final FloatAmountOfSubstanceMatrix asAmountOfSubstance(final AmountOfSubstanceUnit displayUnit)
245 {
246 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AmountOfSubstanceUnit.BASE.getSiDimensions())),
247 UnitRuntimeException.class, "cannot cast %s to FloatAmountOfSubstanceMatrix", this.toString());
248 FloatAmountOfSubstanceMatrix result = new FloatAmountOfSubstanceMatrix(this.data, displayUnit.getStandardUnit());
249 result.setDisplayUnit(displayUnit);
250 return result;
251 }
252
253
254
255
256
257 public final FloatAngularAccelerationMatrix asAngularAcceleration()
258 {
259 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AngularAccelerationUnit.BASE.getSiDimensions())),
260 UnitRuntimeException.class, "cannot cast %s to FloatAngularAccelerationMatrix", this.toString());
261 return new FloatAngularAccelerationMatrix(this.data, AngularAccelerationUnit.SI);
262 }
263
264
265
266
267
268
269 public final FloatAngularAccelerationMatrix asAngularAcceleration(final AngularAccelerationUnit displayUnit)
270 {
271 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AngularAccelerationUnit.BASE.getSiDimensions())),
272 UnitRuntimeException.class, "cannot cast %s to FloatAngularAccelerationMatrix", this.toString());
273 FloatAngularAccelerationMatrix result = new FloatAngularAccelerationMatrix(this.data, displayUnit.getStandardUnit());
274 result.setDisplayUnit(displayUnit);
275 return result;
276 }
277
278
279
280
281
282 public final FloatAngularVelocityMatrix asAngularVelocity()
283 {
284 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AngularVelocityUnit.BASE.getSiDimensions())),
285 UnitRuntimeException.class, "cannot cast %s to FloatAngularVelocityMatrix", this.toString());
286 return new FloatAngularVelocityMatrix(this.data, AngularVelocityUnit.SI);
287 }
288
289
290
291
292
293
294 public final FloatAngularVelocityMatrix asAngularVelocity(final AngularVelocityUnit displayUnit)
295 {
296 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AngularVelocityUnit.BASE.getSiDimensions())),
297 UnitRuntimeException.class, "cannot cast %s to FloatAngularVelocityMatrix", this.toString());
298 FloatAngularVelocityMatrix result = new FloatAngularVelocityMatrix(this.data, displayUnit.getStandardUnit());
299 result.setDisplayUnit(displayUnit);
300 return result;
301 }
302
303
304
305
306
307 public final FloatAreaMatrix asArea()
308 {
309 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AreaUnit.BASE.getSiDimensions())),
310 UnitRuntimeException.class, "cannot cast %s to FloatAreaMatrix", this.toString());
311 return new FloatAreaMatrix(this.data, AreaUnit.SI);
312 }
313
314
315
316
317
318
319 public final FloatAreaMatrix asArea(final AreaUnit displayUnit)
320 {
321 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AreaUnit.BASE.getSiDimensions())),
322 UnitRuntimeException.class, "cannot cast %s to FloatAreaMatrix", this.toString());
323 FloatAreaMatrix result = new FloatAreaMatrix(this.data, displayUnit.getStandardUnit());
324 result.setDisplayUnit(displayUnit);
325 return result;
326 }
327
328
329
330
331
332 public final FloatCatalyticActivityMatrix asCatalyticActivity()
333 {
334 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(CatalyticActivityUnit.BASE.getSiDimensions())),
335 UnitRuntimeException.class, "cannot cast %s to FloatCatalyticActivityMatrix", this.toString());
336 return new FloatCatalyticActivityMatrix(this.data, CatalyticActivityUnit.SI);
337 }
338
339
340
341
342
343
344 public final FloatCatalyticActivityMatrix asCatalyticActivity(final CatalyticActivityUnit displayUnit)
345 {
346 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(CatalyticActivityUnit.BASE.getSiDimensions())),
347 UnitRuntimeException.class, "cannot cast %s to FloatCatalyticActivityMatrix", this.toString());
348 FloatCatalyticActivityMatrix result = new FloatCatalyticActivityMatrix(this.data, displayUnit.getStandardUnit());
349 result.setDisplayUnit(displayUnit);
350 return result;
351 }
352
353
354
355
356
357 public final FloatDensityMatrix asDensity()
358 {
359 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(DensityUnit.BASE.getSiDimensions())),
360 UnitRuntimeException.class, "cannot cast %s to FloatDensityMatrix", this.toString());
361 return new FloatDensityMatrix(this.data, DensityUnit.SI);
362 }
363
364
365
366
367
368
369 public final FloatDensityMatrix asDensity(final DensityUnit displayUnit)
370 {
371 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(DensityUnit.BASE.getSiDimensions())),
372 UnitRuntimeException.class, "cannot cast %s to FloatDensityMatrix", this.toString());
373 FloatDensityMatrix result = new FloatDensityMatrix(this.data, displayUnit.getStandardUnit());
374 result.setDisplayUnit(displayUnit);
375 return result;
376 }
377
378
379
380
381
382 public final FloatDimensionlessMatrix asDimensionless()
383 {
384 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(DimensionlessUnit.BASE.getSiDimensions())),
385 UnitRuntimeException.class, "cannot cast %s to FloatDimensionlessMatrix", this.toString());
386 return new FloatDimensionlessMatrix(this.data, DimensionlessUnit.SI);
387 }
388
389
390
391
392
393
394 public final FloatDimensionlessMatrix asDimensionless(final DimensionlessUnit displayUnit)
395 {
396 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(DimensionlessUnit.BASE.getSiDimensions())),
397 UnitRuntimeException.class, "cannot cast %s to FloatDimensionlessMatrix", this.toString());
398 FloatDimensionlessMatrix result = new FloatDimensionlessMatrix(this.data, displayUnit.getStandardUnit());
399 result.setDisplayUnit(displayUnit);
400 return result;
401 }
402
403
404
405
406
407 public final FloatElectricalCapacitanceMatrix asElectricalCapacitance()
408 {
409 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalCapacitanceUnit.BASE.getSiDimensions())),
410 UnitRuntimeException.class, "cannot cast %s to FloatElectricalCapacitanceMatrix", this.toString());
411 return new FloatElectricalCapacitanceMatrix(this.data, ElectricalCapacitanceUnit.SI);
412 }
413
414
415
416
417
418
419 public final FloatElectricalCapacitanceMatrix asElectricalCapacitance(final ElectricalCapacitanceUnit displayUnit)
420 {
421 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalCapacitanceUnit.BASE.getSiDimensions())),
422 UnitRuntimeException.class, "cannot cast %s to FloatElectricalCapacitanceMatrix", this.toString());
423 FloatElectricalCapacitanceMatrix result =
424 new FloatElectricalCapacitanceMatrix(this.data, displayUnit.getStandardUnit());
425 result.setDisplayUnit(displayUnit);
426 return result;
427 }
428
429
430
431
432
433 public final FloatElectricalChargeMatrix asElectricalCharge()
434 {
435 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalChargeUnit.BASE.getSiDimensions())),
436 UnitRuntimeException.class, "cannot cast %s to FloatElectricalChargeMatrix", this.toString());
437 return new FloatElectricalChargeMatrix(this.data, ElectricalChargeUnit.SI);
438 }
439
440
441
442
443
444
445 public final FloatElectricalChargeMatrix asElectricalCharge(final ElectricalChargeUnit displayUnit)
446 {
447 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalChargeUnit.BASE.getSiDimensions())),
448 UnitRuntimeException.class, "cannot cast %s to FloatElectricalChargeMatrix", this.toString());
449 FloatElectricalChargeMatrix result = new FloatElectricalChargeMatrix(this.data, displayUnit.getStandardUnit());
450 result.setDisplayUnit(displayUnit);
451 return result;
452 }
453
454
455
456
457
458 public final FloatElectricalConductanceMatrix asElectricalConductance()
459 {
460 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalConductanceUnit.BASE.getSiDimensions())),
461 UnitRuntimeException.class, "cannot cast %s to FloatElectricalConductanceMatrix", this.toString());
462 return new FloatElectricalConductanceMatrix(this.data, ElectricalConductanceUnit.SI);
463 }
464
465
466
467
468
469
470 public final FloatElectricalConductanceMatrix asElectricalConductance(final ElectricalConductanceUnit displayUnit)
471 {
472 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalConductanceUnit.BASE.getSiDimensions())),
473 UnitRuntimeException.class, "cannot cast %s to FloatElectricalConductanceMatrix", this.toString());
474 FloatElectricalConductanceMatrix result =
475 new FloatElectricalConductanceMatrix(this.data, displayUnit.getStandardUnit());
476 result.setDisplayUnit(displayUnit);
477 return result;
478 }
479
480
481
482
483
484 public final FloatElectricalCurrentMatrix asElectricalCurrent()
485 {
486 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalCurrentUnit.BASE.getSiDimensions())),
487 UnitRuntimeException.class, "cannot cast %s to FloatElectricalCurrentMatrix", this.toString());
488 return new FloatElectricalCurrentMatrix(this.data, ElectricalCurrentUnit.SI);
489 }
490
491
492
493
494
495
496 public final FloatElectricalCurrentMatrix asElectricalCurrent(final ElectricalCurrentUnit displayUnit)
497 {
498 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalCurrentUnit.BASE.getSiDimensions())),
499 UnitRuntimeException.class, "cannot cast %s to FloatElectricalCurrentMatrix", this.toString());
500 FloatElectricalCurrentMatrix result = new FloatElectricalCurrentMatrix(this.data, displayUnit.getStandardUnit());
501 result.setDisplayUnit(displayUnit);
502 return result;
503 }
504
505
506
507
508
509 public final FloatElectricalInductanceMatrix asElectricalInductance()
510 {
511 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalInductanceUnit.BASE.getSiDimensions())),
512 UnitRuntimeException.class, "cannot cast %s to FloatElectricalInductanceMatrix", this.toString());
513 return new FloatElectricalInductanceMatrix(this.data, ElectricalInductanceUnit.SI);
514 }
515
516
517
518
519
520
521 public final FloatElectricalInductanceMatrix asElectricalInductance(final ElectricalInductanceUnit displayUnit)
522 {
523 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalInductanceUnit.BASE.getSiDimensions())),
524 UnitRuntimeException.class, "cannot cast %s to FloatElectricalInductanceMatrix", this.toString());
525 FloatElectricalInductanceMatrix result = new FloatElectricalInductanceMatrix(this.data, displayUnit.getStandardUnit());
526 result.setDisplayUnit(displayUnit);
527 return result;
528 }
529
530
531
532
533
534 public final FloatElectricalPotentialMatrix asElectricalPotential()
535 {
536 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalPotentialUnit.BASE.getSiDimensions())),
537 UnitRuntimeException.class, "cannot cast %s to FloatElectricalPotentialMatrix", this.toString());
538 return new FloatElectricalPotentialMatrix(this.data, ElectricalPotentialUnit.SI);
539 }
540
541
542
543
544
545
546 public final FloatElectricalPotentialMatrix asElectricalPotential(final ElectricalPotentialUnit displayUnit)
547 {
548 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalPotentialUnit.BASE.getSiDimensions())),
549 UnitRuntimeException.class, "cannot cast %s to FloatElectricalPotentialMatrix", this.toString());
550 FloatElectricalPotentialMatrix result = new FloatElectricalPotentialMatrix(this.data, displayUnit.getStandardUnit());
551 result.setDisplayUnit(displayUnit);
552 return result;
553 }
554
555
556
557
558
559 public final FloatElectricalResistanceMatrix asElectricalResistance()
560 {
561 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalResistanceUnit.BASE.getSiDimensions())),
562 UnitRuntimeException.class, "cannot cast %s to FloatElectricalResistanceMatrix", this.toString());
563 return new FloatElectricalResistanceMatrix(this.data, ElectricalResistanceUnit.SI);
564 }
565
566
567
568
569
570
571 public final FloatElectricalResistanceMatrix asElectricalResistance(final ElectricalResistanceUnit displayUnit)
572 {
573 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ElectricalResistanceUnit.BASE.getSiDimensions())),
574 UnitRuntimeException.class, "cannot cast %s to FloatElectricalResistanceMatrix", this.toString());
575 FloatElectricalResistanceMatrix result = new FloatElectricalResistanceMatrix(this.data, displayUnit.getStandardUnit());
576 result.setDisplayUnit(displayUnit);
577 return result;
578 }
579
580
581
582
583
584 public final FloatEnergyMatrix asEnergy()
585 {
586 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(EnergyUnit.BASE.getSiDimensions())),
587 UnitRuntimeException.class, "cannot cast %s to FloatEnergyMatrix", this.toString());
588 return new FloatEnergyMatrix(this.data, EnergyUnit.SI);
589 }
590
591
592
593
594
595
596 public final FloatEnergyMatrix asEnergy(final EnergyUnit displayUnit)
597 {
598 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(EnergyUnit.BASE.getSiDimensions())),
599 UnitRuntimeException.class, "cannot cast %s to FloatEnergyMatrix", this.toString());
600 FloatEnergyMatrix result = new FloatEnergyMatrix(this.data, displayUnit.getStandardUnit());
601 result.setDisplayUnit(displayUnit);
602 return result;
603 }
604
605
606
607
608
609 public final FloatEquivalentDoseMatrix asEquivalentDose()
610 {
611 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(EquivalentDoseUnit.BASE.getSiDimensions())),
612 UnitRuntimeException.class, "cannot cast %s to FloatEquivalentDoseMatrix", this.toString());
613 return new FloatEquivalentDoseMatrix(this.data, EquivalentDoseUnit.SI);
614 }
615
616
617
618
619
620
621 public final FloatEquivalentDoseMatrix asEquivalentDose(final EquivalentDoseUnit displayUnit)
622 {
623 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(EquivalentDoseUnit.BASE.getSiDimensions())),
624 UnitRuntimeException.class, "cannot cast %s to FloatEquivalentDoseMatrix", this.toString());
625 FloatEquivalentDoseMatrix result = new FloatEquivalentDoseMatrix(this.data, displayUnit.getStandardUnit());
626 result.setDisplayUnit(displayUnit);
627 return result;
628 }
629
630
631
632
633
634 public final FloatFlowMassMatrix asFlowMass()
635 {
636 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(FlowMassUnit.BASE.getSiDimensions())),
637 UnitRuntimeException.class, "cannot cast %s to FloatFlowMassMatrix", this.toString());
638 return new FloatFlowMassMatrix(this.data, FlowMassUnit.SI);
639 }
640
641
642
643
644
645
646 public final FloatFlowMassMatrix asFlowMass(final FlowMassUnit displayUnit)
647 {
648 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(FlowMassUnit.BASE.getSiDimensions())),
649 UnitRuntimeException.class, "cannot cast %s to FloatFlowMassMatrix", this.toString());
650 FloatFlowMassMatrix result = new FloatFlowMassMatrix(this.data, displayUnit.getStandardUnit());
651 result.setDisplayUnit(displayUnit);
652 return result;
653 }
654
655
656
657
658
659 public final FloatFlowVolumeMatrix asFlowVolume()
660 {
661 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(FlowVolumeUnit.BASE.getSiDimensions())),
662 UnitRuntimeException.class, "cannot cast %s to FloatFlowVolumeMatrix", this.toString());
663 return new FloatFlowVolumeMatrix(this.data, FlowVolumeUnit.SI);
664 }
665
666
667
668
669
670
671 public final FloatFlowVolumeMatrix asFlowVolume(final FlowVolumeUnit displayUnit)
672 {
673 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(FlowVolumeUnit.BASE.getSiDimensions())),
674 UnitRuntimeException.class, "cannot cast %s to FloatFlowVolumeMatrix", this.toString());
675 FloatFlowVolumeMatrix result = new FloatFlowVolumeMatrix(this.data, displayUnit.getStandardUnit());
676 result.setDisplayUnit(displayUnit);
677 return result;
678 }
679
680
681
682
683
684 public final FloatForceMatrix asForce()
685 {
686 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ForceUnit.BASE.getSiDimensions())),
687 UnitRuntimeException.class, "cannot cast %s to FloatForceMatrix", this.toString());
688 return new FloatForceMatrix(this.data, ForceUnit.SI);
689 }
690
691
692
693
694
695
696 public final FloatForceMatrix asForce(final ForceUnit displayUnit)
697 {
698 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(ForceUnit.BASE.getSiDimensions())),
699 UnitRuntimeException.class, "cannot cast %s to FloatForceMatrix", this.toString());
700 FloatForceMatrix result = new FloatForceMatrix(this.data, displayUnit.getStandardUnit());
701 result.setDisplayUnit(displayUnit);
702 return result;
703 }
704
705
706
707
708
709 public final FloatFrequencyMatrix asFrequency()
710 {
711 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(FrequencyUnit.BASE.getSiDimensions())),
712 UnitRuntimeException.class, "cannot cast %s to FloatFrequencyMatrix", this.toString());
713 return new FloatFrequencyMatrix(this.data, FrequencyUnit.SI);
714 }
715
716
717
718
719
720
721 public final FloatFrequencyMatrix asFrequency(final FrequencyUnit displayUnit)
722 {
723 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(FrequencyUnit.BASE.getSiDimensions())),
724 UnitRuntimeException.class, "cannot cast %s to FloatFrequencyMatrix", this.toString());
725 FloatFrequencyMatrix result = new FloatFrequencyMatrix(this.data, displayUnit.getStandardUnit());
726 result.setDisplayUnit(displayUnit);
727 return result;
728 }
729
730
731
732
733
734 public final FloatIlluminanceMatrix asIlluminance()
735 {
736 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(IlluminanceUnit.BASE.getSiDimensions())),
737 UnitRuntimeException.class, "cannot cast %s to FloatIlluminanceMatrix", this.toString());
738 return new FloatIlluminanceMatrix(this.data, IlluminanceUnit.SI);
739 }
740
741
742
743
744
745
746 public final FloatIlluminanceMatrix asIlluminance(final IlluminanceUnit displayUnit)
747 {
748 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(IlluminanceUnit.BASE.getSiDimensions())),
749 UnitRuntimeException.class, "cannot cast %s to FloatIlluminanceMatrix", this.toString());
750 FloatIlluminanceMatrix result = new FloatIlluminanceMatrix(this.data, displayUnit.getStandardUnit());
751 result.setDisplayUnit(displayUnit);
752 return result;
753 }
754
755
756
757
758
759 public final FloatLinearDensityMatrix asLinearDensity()
760 {
761 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(LinearDensityUnit.BASE.getSiDimensions())),
762 UnitRuntimeException.class, "cannot cast %s to FloatLinearDensityMatrix", this.toString());
763 return new FloatLinearDensityMatrix(this.data, LinearDensityUnit.SI);
764 }
765
766
767
768
769
770
771 public final FloatLinearDensityMatrix asLinearDensity(final LinearDensityUnit displayUnit)
772 {
773 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(LinearDensityUnit.BASE.getSiDimensions())),
774 UnitRuntimeException.class, "cannot cast %s to FloatLinearDensityMatrix", this.toString());
775 FloatLinearDensityMatrix result = new FloatLinearDensityMatrix(this.data, displayUnit.getStandardUnit());
776 result.setDisplayUnit(displayUnit);
777 return result;
778 }
779
780
781
782
783
784 public final FloatLuminousFluxMatrix asLuminousFlux()
785 {
786 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(LuminousFluxUnit.BASE.getSiDimensions())),
787 UnitRuntimeException.class, "cannot cast %s to FloatLuminousFluxMatrix", this.toString());
788 return new FloatLuminousFluxMatrix(this.data, LuminousFluxUnit.SI);
789 }
790
791
792
793
794
795
796 public final FloatLuminousFluxMatrix asLuminousFlux(final LuminousFluxUnit displayUnit)
797 {
798 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(LuminousFluxUnit.BASE.getSiDimensions())),
799 UnitRuntimeException.class, "cannot cast %s to FloatLuminousFluxMatrix", this.toString());
800 FloatLuminousFluxMatrix result = new FloatLuminousFluxMatrix(this.data, displayUnit.getStandardUnit());
801 result.setDisplayUnit(displayUnit);
802 return result;
803 }
804
805
806
807
808
809 public final FloatLuminousIntensityMatrix asLuminousIntensity()
810 {
811 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(LuminousIntensityUnit.BASE.getSiDimensions())),
812 UnitRuntimeException.class, "cannot cast %s to FloatLuminousIntensityMatrix", this.toString());
813 return new FloatLuminousIntensityMatrix(this.data, LuminousIntensityUnit.SI);
814 }
815
816
817
818
819
820
821 public final FloatLuminousIntensityMatrix asLuminousIntensity(final LuminousIntensityUnit displayUnit)
822 {
823 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(LuminousIntensityUnit.BASE.getSiDimensions())),
824 UnitRuntimeException.class, "cannot cast %s to FloatLuminousIntensityMatrix", this.toString());
825 FloatLuminousIntensityMatrix result = new FloatLuminousIntensityMatrix(this.data, displayUnit.getStandardUnit());
826 result.setDisplayUnit(displayUnit);
827 return result;
828 }
829
830
831
832
833
834 public final FloatMagneticFluxDensityMatrix asMagneticFluxDensity()
835 {
836 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(MagneticFluxDensityUnit.BASE.getSiDimensions())),
837 UnitRuntimeException.class, "cannot cast %s to FloatMagneticFluxDensityMatrix", this.toString());
838 return new FloatMagneticFluxDensityMatrix(this.data, MagneticFluxDensityUnit.SI);
839 }
840
841
842
843
844
845
846 public final FloatMagneticFluxDensityMatrix asMagneticFluxDensity(final MagneticFluxDensityUnit displayUnit)
847 {
848 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(MagneticFluxDensityUnit.BASE.getSiDimensions())),
849 UnitRuntimeException.class, "cannot cast %s to FloatMagneticFluxDensityMatrix", this.toString());
850 FloatMagneticFluxDensityMatrix result = new FloatMagneticFluxDensityMatrix(this.data, displayUnit.getStandardUnit());
851 result.setDisplayUnit(displayUnit);
852 return result;
853 }
854
855
856
857
858
859 public final FloatMagneticFluxMatrix asMagneticFlux()
860 {
861 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(MagneticFluxUnit.BASE.getSiDimensions())),
862 UnitRuntimeException.class, "cannot cast %s to FloatMagneticFluxMatrix", this.toString());
863 return new FloatMagneticFluxMatrix(this.data, MagneticFluxUnit.SI);
864 }
865
866
867
868
869
870
871 public final FloatMagneticFluxMatrix asMagneticFlux(final MagneticFluxUnit displayUnit)
872 {
873 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(MagneticFluxUnit.BASE.getSiDimensions())),
874 UnitRuntimeException.class, "cannot cast %s to FloatMagneticFluxMatrix", this.toString());
875 FloatMagneticFluxMatrix result = new FloatMagneticFluxMatrix(this.data, displayUnit.getStandardUnit());
876 result.setDisplayUnit(displayUnit);
877 return result;
878 }
879
880
881
882
883
884 public final FloatMassMatrix asMass()
885 {
886 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(MassUnit.BASE.getSiDimensions())),
887 UnitRuntimeException.class, "cannot cast %s to FloatMassMatrix", this.toString());
888 return new FloatMassMatrix(this.data, MassUnit.SI);
889 }
890
891
892
893
894
895
896 public final FloatMassMatrix asMass(final MassUnit displayUnit)
897 {
898 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(MassUnit.BASE.getSiDimensions())),
899 UnitRuntimeException.class, "cannot cast %s to FloatMassMatrix", this.toString());
900 FloatMassMatrix result = new FloatMassMatrix(this.data, displayUnit.getStandardUnit());
901 result.setDisplayUnit(displayUnit);
902 return result;
903 }
904
905
906
907
908
909 public final FloatMomentumMatrix asMomentum()
910 {
911 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(MomentumUnit.BASE.getSiDimensions())),
912 UnitRuntimeException.class, "cannot cast %s to FloatMomentumMatrix", this.toString());
913 return new FloatMomentumMatrix(this.data, MomentumUnit.SI);
914 }
915
916
917
918
919
920
921 public final FloatMomentumMatrix asMomentum(final MomentumUnit displayUnit)
922 {
923 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(MomentumUnit.BASE.getSiDimensions())),
924 UnitRuntimeException.class, "cannot cast %s to FloatMomentumMatrix", this.toString());
925 FloatMomentumMatrix result = new FloatMomentumMatrix(this.data, displayUnit.getStandardUnit());
926 result.setDisplayUnit(displayUnit);
927 return result;
928 }
929
930
931
932
933
934 public final FloatPowerMatrix asPower()
935 {
936 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(PowerUnit.BASE.getSiDimensions())),
937 UnitRuntimeException.class, "cannot cast %s to FloatPowerMatrix", this.toString());
938 return new FloatPowerMatrix(this.data, PowerUnit.SI);
939 }
940
941
942
943
944
945
946 public final FloatPowerMatrix asPower(final PowerUnit displayUnit)
947 {
948 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(PowerUnit.BASE.getSiDimensions())),
949 UnitRuntimeException.class, "cannot cast %s to FloatPowerMatrix", this.toString());
950 FloatPowerMatrix result = new FloatPowerMatrix(this.data, displayUnit.getStandardUnit());
951 result.setDisplayUnit(displayUnit);
952 return result;
953 }
954
955
956
957
958
959 public final FloatPressureMatrix asPressure()
960 {
961 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(PressureUnit.BASE.getSiDimensions())),
962 UnitRuntimeException.class, "cannot cast %s to FloatPressureMatrix", this.toString());
963 return new FloatPressureMatrix(this.data, PressureUnit.SI);
964 }
965
966
967
968
969
970
971 public final FloatPressureMatrix asPressure(final PressureUnit displayUnit)
972 {
973 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(PressureUnit.BASE.getSiDimensions())),
974 UnitRuntimeException.class, "cannot cast %s to FloatPressureMatrix", this.toString());
975 FloatPressureMatrix result = new FloatPressureMatrix(this.data, displayUnit.getStandardUnit());
976 result.setDisplayUnit(displayUnit);
977 return result;
978 }
979
980
981
982
983
984 public final FloatRadioActivityMatrix asRadioActivity()
985 {
986 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(RadioActivityUnit.BASE.getSiDimensions())),
987 UnitRuntimeException.class, "cannot cast %s to FloatRadioActivityMatrix", this.toString());
988 return new FloatRadioActivityMatrix(this.data, RadioActivityUnit.SI);
989 }
990
991
992
993
994
995
996 public final FloatRadioActivityMatrix asRadioActivity(final RadioActivityUnit displayUnit)
997 {
998 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(RadioActivityUnit.BASE.getSiDimensions())),
999 UnitRuntimeException.class, "cannot cast %s to FloatRadioActivityMatrix", this.toString());
1000 FloatRadioActivityMatrix result = new FloatRadioActivityMatrix(this.data, displayUnit.getStandardUnit());
1001 result.setDisplayUnit(displayUnit);
1002 return result;
1003 }
1004
1005
1006
1007
1008
1009 public final FloatSolidAngleMatrix asSolidAngle()
1010 {
1011 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(SolidAngleUnit.BASE.getSiDimensions())),
1012 UnitRuntimeException.class, "cannot cast %s to FloatSolidAngleMatrix", this.toString());
1013 return new FloatSolidAngleMatrix(this.data, SolidAngleUnit.SI);
1014 }
1015
1016
1017
1018
1019
1020
1021 public final FloatSolidAngleMatrix asSolidAngle(final SolidAngleUnit displayUnit)
1022 {
1023 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(SolidAngleUnit.BASE.getSiDimensions())),
1024 UnitRuntimeException.class, "cannot cast %s to FloatSolidAngleMatrix", this.toString());
1025 FloatSolidAngleMatrix result = new FloatSolidAngleMatrix(this.data, displayUnit.getStandardUnit());
1026 result.setDisplayUnit(displayUnit);
1027 return result;
1028 }
1029
1030
1031
1032
1033
1034 public final FloatSpeedMatrix asSpeed()
1035 {
1036 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(SpeedUnit.BASE.getSiDimensions())),
1037 UnitRuntimeException.class, "cannot cast %s to FloatSpeedMatrix", this.toString());
1038 return new FloatSpeedMatrix(this.data, SpeedUnit.SI);
1039 }
1040
1041
1042
1043
1044
1045
1046 public final FloatSpeedMatrix asSpeed(final SpeedUnit displayUnit)
1047 {
1048 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(SpeedUnit.BASE.getSiDimensions())),
1049 UnitRuntimeException.class, "cannot cast %s to FloatSpeedMatrix", this.toString());
1050 FloatSpeedMatrix result = new FloatSpeedMatrix(this.data, displayUnit.getStandardUnit());
1051 result.setDisplayUnit(displayUnit);
1052 return result;
1053 }
1054
1055
1056
1057
1058
1059 public final FloatTorqueMatrix asTorque()
1060 {
1061 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(TorqueUnit.BASE.getSiDimensions())),
1062 UnitRuntimeException.class, "cannot cast %s to FloatTorqueMatrix", this.toString());
1063 return new FloatTorqueMatrix(this.data, TorqueUnit.SI);
1064 }
1065
1066
1067
1068
1069
1070
1071 public final FloatTorqueMatrix asTorque(final TorqueUnit displayUnit)
1072 {
1073 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(TorqueUnit.BASE.getSiDimensions())),
1074 UnitRuntimeException.class, "cannot cast %s to FloatTorqueMatrix", this.toString());
1075 FloatTorqueMatrix result = new FloatTorqueMatrix(this.data, displayUnit.getStandardUnit());
1076 result.setDisplayUnit(displayUnit);
1077 return result;
1078 }
1079
1080
1081
1082
1083
1084 public final FloatVolumeMatrix asVolume()
1085 {
1086 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(VolumeUnit.BASE.getSiDimensions())),
1087 UnitRuntimeException.class, "cannot cast %s to FloatVolumeMatrix", this.toString());
1088 return new FloatVolumeMatrix(this.data, VolumeUnit.SI);
1089 }
1090
1091
1092
1093
1094
1095
1096 public final FloatVolumeMatrix asVolume(final VolumeUnit displayUnit)
1097 {
1098 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(VolumeUnit.BASE.getSiDimensions())),
1099 UnitRuntimeException.class, "cannot cast %s to FloatVolumeMatrix", this.toString());
1100 FloatVolumeMatrix result = new FloatVolumeMatrix(this.data, displayUnit.getStandardUnit());
1101 result.setDisplayUnit(displayUnit);
1102 return result;
1103 }
1104
1105
1106
1107
1108
1109 public final FloatAngleMatrix asAngle()
1110 {
1111 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AngleUnit.BASE.getSiDimensions())),
1112 UnitRuntimeException.class, "cannot cast %s to FloatAngleMatrix", this.toString());
1113 return new FloatAngleMatrix(this.data, AngleUnit.SI);
1114 }
1115
1116
1117
1118
1119
1120
1121 public final FloatAngleMatrix asAngle(final AngleUnit displayUnit)
1122 {
1123 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(AngleUnit.BASE.getSiDimensions())),
1124 UnitRuntimeException.class, "cannot cast %s to FloatAngleMatrix", this.toString());
1125 FloatAngleMatrix result = new FloatAngleMatrix(this.data, displayUnit.getStandardUnit());
1126 result.setDisplayUnit(displayUnit);
1127 return result;
1128 }
1129
1130
1131
1132
1133
1134 public final FloatLengthMatrix asLength()
1135 {
1136 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(LengthUnit.BASE.getSiDimensions())),
1137 UnitRuntimeException.class, "cannot cast %s to FloatLengthMatrix", this.toString());
1138 return new FloatLengthMatrix(this.data, LengthUnit.SI);
1139 }
1140
1141
1142
1143
1144
1145
1146 public final FloatLengthMatrix asLength(final LengthUnit displayUnit)
1147 {
1148 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(LengthUnit.BASE.getSiDimensions())),
1149 UnitRuntimeException.class, "cannot cast %s to FloatLengthMatrix", this.toString());
1150 FloatLengthMatrix result = new FloatLengthMatrix(this.data, displayUnit.getStandardUnit());
1151 result.setDisplayUnit(displayUnit);
1152 return result;
1153 }
1154
1155
1156
1157
1158
1159 public final FloatTemperatureMatrix asTemperature()
1160 {
1161 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(TemperatureUnit.BASE.getSiDimensions())),
1162 UnitRuntimeException.class, "cannot cast %s to FloatTemperatureMatrix", this.toString());
1163 return new FloatTemperatureMatrix(this.data, TemperatureUnit.SI);
1164 }
1165
1166
1167
1168
1169
1170
1171 public final FloatTemperatureMatrix asTemperature(final TemperatureUnit displayUnit)
1172 {
1173 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(TemperatureUnit.BASE.getSiDimensions())),
1174 UnitRuntimeException.class, "cannot cast %s to FloatTemperatureMatrix", this.toString());
1175 FloatTemperatureMatrix result = new FloatTemperatureMatrix(this.data, displayUnit.getStandardUnit());
1176 result.setDisplayUnit(displayUnit);
1177 return result;
1178 }
1179
1180
1181
1182
1183
1184 public final FloatDurationMatrix asDuration()
1185 {
1186 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(DurationUnit.BASE.getSiDimensions())),
1187 UnitRuntimeException.class, "cannot cast %s to FloatDurationMatrix", this.toString());
1188 return new FloatDurationMatrix(this.data, DurationUnit.SI);
1189 }
1190
1191
1192
1193
1194
1195
1196 public final FloatDurationMatrix asDuration(final DurationUnit displayUnit)
1197 {
1198 Throw.when(!(getDisplayUnit().getQuantity().getSiDimensions().equals(DurationUnit.BASE.getSiDimensions())),
1199 UnitRuntimeException.class, "cannot cast %s to FloatDurationMatrix", this.toString());
1200 FloatDurationMatrix result = new FloatDurationMatrix(this.data, displayUnit.getStandardUnit());
1201 result.setDisplayUnit(displayUnit);
1202 return result;
1203 }
1204
1205 }