View Javadoc
1   package org.djunits.value.vfloat.matrix;
2   
3   import java.util.Collection;
4   
5   import org.djunits.unit.AbsoluteTemperatureUnit;
6   import org.djunits.unit.TemperatureUnit;
7   import org.djunits.value.storage.StorageType;
8   import org.djunits.value.vfloat.matrix.base.FloatMatrixAbs;
9   import org.djunits.value.vfloat.matrix.base.FloatSparseValue;
10  import org.djunits.value.vfloat.matrix.data.FloatMatrixData;
11  import org.djunits.value.vfloat.scalar.FloatAbsoluteTemperature;
12  import org.djunits.value.vfloat.scalar.FloatTemperature;
13  import org.djunits.value.vfloat.vector.FloatAbsoluteTemperatureVector;
14  import org.djunits.value.vfloat.vector.FloatTemperatureVector;
15  import org.djunits.value.vfloat.vector.data.FloatVectorData;
16  
17  import jakarta.annotation.Generated;
18  
19  /**
20   * Immutable FloatAbsoluteTemperature Matrix.
21   * <p>
22   * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
23   * BSD-style license. See <a href="https://djunits.org/docs/license.html">DJUNITS License</a>.
24   * </p>
25   * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
26   * @author <a href="https://www.tudelft.nl/staff/p.knoppers/">Peter Knoppers</a>
27   */
28  @Generated(value = "org.djunits.generator.GenerateDJUNIT", date = "2023-07-23T14:06:38.224104100Z")
29  public class FloatAbsoluteTemperatureMatrix extends
30          FloatMatrixAbs<AbsoluteTemperatureUnit, FloatAbsoluteTemperature, FloatAbsoluteTemperatureVector,
31                  FloatAbsoluteTemperatureMatrix, TemperatureUnit, FloatTemperature, FloatTemperatureVector,
32                  FloatTemperatureMatrix>
33  {
34      /** */
35      private static final long serialVersionUID = 20151006L;
36  
37      /**
38       * Construct a AbsoluteTemperatureMatrix from an internal data object.
39       * @param data FloatMatrixData; the internal data object for the matrix
40       * @param displayUnit AbsoluteTemperatureUnit; the display unit of the matrix data
41       */
42      public FloatAbsoluteTemperatureMatrix(final FloatMatrixData data, final AbsoluteTemperatureUnit displayUnit)
43      {
44          super(data, displayUnit);
45      }
46  
47      /* CONSTRUCTORS WITH float[][] */
48  
49      /**
50       * Construct a FloatAbsoluteTemperatureMatrix from a float[][] object. The float values are expressed in the displayUnit,
51       * and will be printed using the displayUnit.
52       * @param data float[][]; the data for the matrix, expressed in the displayUnit
53       * @param displayUnit AbsoluteTemperatureUnit; the unit of the values in the data array, and display unit when printing
54       * @param storageType StorageType; the StorageType (SPARSE or DENSE) to use for constructing the Matrix
55       */
56      public FloatAbsoluteTemperatureMatrix(final float[][] data, final AbsoluteTemperatureUnit displayUnit,
57              final StorageType storageType)
58      {
59          this(FloatMatrixData.instantiate(data, displayUnit.getScale(), storageType), displayUnit);
60      }
61  
62      /**
63       * Construct a FloatAbsoluteTemperatureMatrix from a float[][] object. The float values are expressed in the displayUnit.
64       * Assume that the StorageType is DENSE since we offer the data as an array of an array.
65       * @param data float[][]; the data for the matrix
66       * @param displayUnit AbsoluteTemperatureUnit; the unit of the values in the data array, and display unit when printing
67       */
68      public FloatAbsoluteTemperatureMatrix(final float[][] data, final AbsoluteTemperatureUnit displayUnit)
69      {
70          this(data, displayUnit, StorageType.DENSE);
71      }
72  
73      /**
74       * Construct a FloatAbsoluteTemperatureMatrix from a float[][] object with SI-unit values.
75       * @param data float[][]; the data for the matrix, in SI units
76       * @param storageType StorageType; the StorageType (SPARSE or DENSE) to use for constructing the Matrix
77       */
78      public FloatAbsoluteTemperatureMatrix(final float[][] data, final StorageType storageType)
79      {
80          this(data, AbsoluteTemperatureUnit.BASE.getStandardUnit(), storageType);
81      }
82  
83      /**
84       * Construct a FloatAbsoluteTemperatureMatrix from a float[][] object with SI-unit values. Assume that the StorageType is
85       * DENSE since we offer the data as an array of an array.
86       * @param data float[][]; the data for the matrix, in SI units
87       */
88      public FloatAbsoluteTemperatureMatrix(final float[][] data)
89      {
90          this(data, StorageType.DENSE);
91      }
92  
93      /* CONSTRUCTORS WITH FloatAbsoluteTemperature[][] */
94  
95      /**
96       * Construct a FloatAbsoluteTemperatureMatrix from an array of an array of FloatAbsoluteTemperature objects. The
97       * FloatAbsoluteTemperature values are each expressed in their own unit, but will be internally stored as SI values, all
98       * expressed in the displayUnit when printing.
99       * @param data FloatAbsoluteTemperature[][]; the data for the matrix
100      * @param displayUnit AbsoluteTemperatureUnit; the display unit of the values when printing
101      * @param storageType StorageType; the StorageType (SPARSE or DENSE) to use for constructing the Matrix
102      */
103     public FloatAbsoluteTemperatureMatrix(final FloatAbsoluteTemperature[][] data, final AbsoluteTemperatureUnit displayUnit,
104             final StorageType storageType)
105     {
106         this(FloatMatrixData.instantiate(data, storageType), displayUnit);
107     }
108 
109     /**
110      * Construct a FloatAbsoluteTemperatureMatrix from an array of an array of FloatAbsoluteTemperature objects. The
111      * FloatAbsoluteTemperature values are each expressed in their own unit, but will be internally stored as SI values, all
112      * expressed in the displayUnit when printing. Assume that the StorageType is DENSE since we offer the data as an array of
113      * an array.
114      * @param data FloatAbsoluteTemperature[][]; the data for the matrix
115      * @param displayUnit AbsoluteTemperatureUnit; the display unit of the values when printing
116      */
117     public FloatAbsoluteTemperatureMatrix(final FloatAbsoluteTemperature[][] data, final AbsoluteTemperatureUnit displayUnit)
118     {
119         this(data, displayUnit, StorageType.DENSE);
120     }
121 
122     /**
123      * Construct a FloatAbsoluteTemperatureMatrix from an array of an array of FloatAbsoluteTemperature objects. The
124      * FloatAbsoluteTemperature values are each expressed in their own unit, but will be internally stored as SI values, and
125      * expressed using SI units when printing. since we offer the data as an array of an array.
126      * @param data FloatAbsoluteTemperature[][]; the data for the matrix
127      * @param storageType StorageType; the StorageType (SPARSE or DENSE) to use for constructing the Matrix
128      */
129     public FloatAbsoluteTemperatureMatrix(final FloatAbsoluteTemperature[][] data, final StorageType storageType)
130     {
131         this(data, AbsoluteTemperatureUnit.BASE.getStandardUnit(), storageType);
132     }
133 
134     /**
135      * Construct a FloatAbsoluteTemperatureMatrix from an array of an array of FloatAbsoluteTemperature objects. The
136      * FloatAbsoluteTemperature values are each expressed in their own unit, but will be internally stored as SI values, and
137      * expressed using SI units when printing. Assume that the StorageType is DENSE since we offer the data as an array of an
138      * array.
139      * @param data FloatAbsoluteTemperature[][]; the data for the matrix
140      */
141     public FloatAbsoluteTemperatureMatrix(final FloatAbsoluteTemperature[][] data)
142     {
143         this(data, StorageType.DENSE);
144     }
145 
146     /* CONSTRUCTORS WITH Collection<FloatSparseValue> */
147 
148     /**
149      * Construct a FloatAbsoluteTemperatureMatrix from a (sparse) collection of FloatSparseValue objects. The displayUnit
150      * indicates the unit in which the values in the collection are expressed, as well as the unit in which they will be
151      * printed.
152      * @param data Collection&lt;FloatSparseValue&gt;; the data for the matrix
153      * @param displayUnit AbsoluteTemperatureUnit; the display unit of the matrix data, and the unit of the data points
154      * @param rows int; the number of rows of the matrix
155      * @param cols int; the number of columns of the matrix
156      * @param storageType StorageType; the StorageType (SPARSE or DENSE) to use for constructing the Matrix
157      */
158     public FloatAbsoluteTemperatureMatrix(
159             final Collection<FloatSparseValue<AbsoluteTemperatureUnit, FloatAbsoluteTemperature>> data,
160             final AbsoluteTemperatureUnit displayUnit, final int rows, final int cols, final StorageType storageType)
161     {
162         this(FloatMatrixData.instantiate(data, rows, cols, storageType), displayUnit);
163     }
164 
165     /**
166      * Construct a FloatAbsoluteTemperatureMatrix from a (sparse) collection of FloatSparseValue objects. The displayUnit
167      * indicates the unit in which the values in the collection are expressed, as well as the unit in which they will be
168      * printed. Assume the storage type is SPARSE, since we offer the data as a collection.
169      * @param data Collection&lt;FloatSparseValue&gt;; the data for the matrix
170      * @param displayUnit AbsoluteTemperatureUnit; the display unit of the matrix data, and the unit of the data points
171      * @param rows int; the number of rows of the matrix
172      * @param cols int; the number of columns of the matrix
173      */
174     public FloatAbsoluteTemperatureMatrix(
175             final Collection<FloatSparseValue<AbsoluteTemperatureUnit, FloatAbsoluteTemperature>> data,
176             final AbsoluteTemperatureUnit displayUnit, final int rows, final int cols)
177     {
178         this(data, displayUnit, rows, cols, StorageType.SPARSE);
179     }
180 
181     /**
182      * Construct a FloatAbsoluteTemperatureMatrix from a (sparse) collection of FloatSparseValue objects. The displayUnit
183      * indicates the unit in which the values in the collection are expressed, as well as the unit in which they will be
184      * printed. Use the SI unit or base unit as the displayUnit.
185      * @param data Collection&lt;FloatSparseValue&gt;; the data for the matrix
186      * @param rows int; the number of rows of the matrix
187      * @param cols int; the number of columns of the matrix
188      * @param storageType StorageType; the StorageType (SPARSE or DENSE) to use for constructing the Matrix
189      */
190     public FloatAbsoluteTemperatureMatrix(
191             final Collection<FloatSparseValue<AbsoluteTemperatureUnit, FloatAbsoluteTemperature>> data, final int rows,
192             final int cols, final StorageType storageType)
193     {
194         this(data, AbsoluteTemperatureUnit.BASE.getStandardUnit(), rows, cols, storageType);
195     }
196 
197     /**
198      * Construct a FloatAbsoluteTemperatureMatrix from a (sparse) collection of FloatSparseValue objects. The displayUnit
199      * indicates the unit in which the values in the collection are expressed, as well as the unit in which they will be
200      * printed. Use the SI unit or base unit as the displayUnit. Assume the storage type is SPARSE, since we offer the data as a
201      * collection.
202      * @param data Collection&lt;FloatSparseValue&gt;; the data for the matrix
203      * @param rows int; the number of rows of the matrix
204      * @param cols int; the number of columns of the matrix
205      */
206     public FloatAbsoluteTemperatureMatrix(
207             final Collection<FloatSparseValue<AbsoluteTemperatureUnit, FloatAbsoluteTemperature>> data, final int rows,
208             final int cols)
209     {
210         this(data, AbsoluteTemperatureUnit.BASE.getStandardUnit(), rows, cols, StorageType.SPARSE);
211     }
212 
213     @Override
214     public Class<FloatAbsoluteTemperature> getScalarClass()
215     {
216         return FloatAbsoluteTemperature.class;
217     }
218 
219     @Override
220     public Class<FloatAbsoluteTemperatureVector> getVectorClass()
221     {
222         return FloatAbsoluteTemperatureVector.class;
223     }
224 
225     @Override
226     public FloatAbsoluteTemperatureMatrix instantiateMatrix(final FloatMatrixData fmd,
227             final AbsoluteTemperatureUnit displayUnit)
228     {
229         return new FloatAbsoluteTemperatureMatrix(fmd, displayUnit);
230     }
231 
232     @Override
233     public FloatAbsoluteTemperatureVector instantiateVector(final FloatVectorData fvd,
234             final AbsoluteTemperatureUnit displayUnit)
235     {
236         return new FloatAbsoluteTemperatureVector(fvd, displayUnit);
237     }
238 
239     @Override
240     public FloatAbsoluteTemperature instantiateScalarSI(final float valueSI, final AbsoluteTemperatureUnit displayUnit)
241     {
242         FloatAbsoluteTemperature result = FloatAbsoluteTemperature.instantiateSI(valueSI);
243         result.setDisplayUnit(displayUnit);
244         return result;
245     }
246 
247     @Override
248     public FloatTemperatureMatrix instantiateMatrixRel(final FloatMatrixData fmd, final TemperatureUnit displayUnit)
249     {
250         return new FloatTemperatureMatrix(fmd, displayUnit);
251     }
252 
253     @Override
254     public FloatTemperatureVector instantiateVectorRel(final FloatVectorData fvd, final TemperatureUnit displayUnit)
255     {
256         return new FloatTemperatureVector(fvd, displayUnit);
257     }
258 
259     @Override
260     public FloatTemperature instantiateScalarRelSI(final float valueSI, final TemperatureUnit displayUnit)
261     {
262         FloatTemperature result = FloatTemperature.instantiateSI(valueSI);
263         result.setDisplayUnit(displayUnit);
264         return result;
265     }
266 
267 }