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