View Javadoc
1   package org.djunits.value.vdouble.matrix;
2   
3   import java.util.Collection;
4   
5   import org.djunits.unit.AngularVelocityUnit;
6   import org.djunits.value.storage.StorageType;
7   import org.djunits.value.vdouble.matrix.base.DoubleMatrixRel;
8   import org.djunits.value.vdouble.matrix.base.DoubleSparseValue;
9   import org.djunits.value.vdouble.matrix.data.DoubleMatrixData;
10  import org.djunits.value.vdouble.scalar.AngularVelocity;
11  import org.djunits.value.vdouble.vector.AngularVelocityVector;
12  import org.djunits.value.vdouble.vector.data.DoubleVectorData;
13  
14  import jakarta.annotation.Generated;
15  
16  /**
17   * Immutable Double AngularVelocityMatrix, a matrix of values with a AngularVelocityUnit.
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 AngularVelocityMatrix
27          extends DoubleMatrixRel<AngularVelocityUnit, AngularVelocity, AngularVelocityVector, AngularVelocityMatrix>
28  
29  {
30      /** */
31      private static final long serialVersionUID = 20151109L;
32  
33      /**
34       * Construct a AngularVelocityMatrix from an internal data object.
35       * @param data DoubleMatrixData; the internal data object for the matrix
36       * @param displayUnit AngularVelocityUnit; the display unit of the matrix data
37       */
38      public AngularVelocityMatrix(final DoubleMatrixData data, final AngularVelocityUnit displayUnit)
39      {
40          super(data, displayUnit);
41      }
42  
43      /* CONSTRUCTORS WITH double[][] */
44  
45      /**
46       * Construct a AngularVelocityMatrix from a double[][] object. The double values are expressed in the displayUnit, and will
47       * be printed using the displayUnit.
48       * @param data double[][]; the data for the matrix, expressed in the displayUnit
49       * @param displayUnit AngularVelocityUnit; 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 AngularVelocityMatrix(final double[][] data, final AngularVelocityUnit displayUnit, final StorageType storageType)
53      {
54          this(DoubleMatrixData.instantiate(data, displayUnit.getScale(), storageType), displayUnit);
55      }
56  
57      /**
58       * Construct a AngularVelocityMatrix from a double[][] object. The double values are expressed in the displayUnit. Assume
59       * that the StorageType is DENSE since we offer the data as an array of an array.
60       * @param data double[][]; the data for the matrix
61       * @param displayUnit AngularVelocityUnit; the unit of the values in the data array, and display unit when printing
62       */
63      public AngularVelocityMatrix(final double[][] data, final AngularVelocityUnit displayUnit)
64      {
65          this(data, displayUnit, StorageType.DENSE);
66      }
67  
68      /**
69       * Construct a AngularVelocityMatrix from a double[][] object with SI-unit values.
70       * @param data double[][]; the data for the matrix, in SI units
71       * @param storageType StorageType; the StorageType (SPARSE or DENSE) to use for constructing the Matrix
72       */
73      public AngularVelocityMatrix(final double[][] data, final StorageType storageType)
74      {
75          this(data, AngularVelocityUnit.SI, storageType);
76      }
77  
78      /**
79       * Construct a AngularVelocityMatrix from a double[][] object with SI-unit values. Assume that the StorageType is DENSE
80       * since we offer the data as an array of an array.
81       * @param data double[][]; the data for the matrix, in SI units
82       */
83      public AngularVelocityMatrix(final double[][] data)
84      {
85          this(data, StorageType.DENSE);
86      }
87  
88      /* CONSTRUCTORS WITH AngularVelocity[][] */
89  
90      /**
91       * Construct a AngularVelocityMatrix from an array of an array of AngularVelocity objects. The AngularVelocity values are
92       * each expressed in their own unit, but will be internally stored as SI values, all expressed in the displayUnit when
93       * printing.
94       * @param data AngularVelocity[][]; the data for the matrix
95       * @param displayUnit AngularVelocityUnit; the display unit of the values when printing
96       * @param storageType StorageType; the StorageType (SPARSE or DENSE) to use for constructing the Matrix
97       */
98      public AngularVelocityMatrix(final AngularVelocity[][] data, final AngularVelocityUnit displayUnit,
99              final StorageType storageType)
100     {
101         this(DoubleMatrixData.instantiate(data, storageType), displayUnit);
102     }
103 
104     /**
105      * Construct a AngularVelocityMatrix from an array of an array of AngularVelocity objects. The AngularVelocity values are
106      * each expressed in their own unit, but will be internally stored as SI values, all expressed in the displayUnit when
107      * printing. Assume that the StorageType is DENSE since we offer the data as an array of an array.
108      * @param data AngularVelocity[][]; the data for the matrix
109      * @param displayUnit AngularVelocityUnit; the display unit of the values when printing
110      */
111     public AngularVelocityMatrix(final AngularVelocity[][] data, final AngularVelocityUnit displayUnit)
112     {
113         this(data, displayUnit, StorageType.DENSE);
114     }
115 
116     /**
117      * Construct a AngularVelocityMatrix from an array of an array of AngularVelocity objects. The AngularVelocity values are
118      * each expressed in their own unit, but will be internally stored as SI values, and expressed using SI units when printing.
119      * since we offer the data as an array of an array.
120      * @param data AngularVelocity[][]; the data for the matrix
121      * @param storageType StorageType; the StorageType (SPARSE or DENSE) to use for constructing the Matrix
122      */
123     public AngularVelocityMatrix(final AngularVelocity[][] data, final StorageType storageType)
124     {
125         this(data, AngularVelocityUnit.SI, storageType);
126     }
127 
128     /**
129      * Construct a AngularVelocityMatrix from an array of an array of AngularVelocity objects. The AngularVelocity values are
130      * each expressed in their own unit, but will be internally stored as SI values, and expressed using SI units when printing.
131      * Assume that the StorageType is DENSE since we offer the data as an array of an array.
132      * @param data AngularVelocity[][]; the data for the matrix
133      */
134     public AngularVelocityMatrix(final AngularVelocity[][] data)
135     {
136         this(data, StorageType.DENSE);
137     }
138 
139     /* CONSTRUCTORS WITH Collection<DoubleSparseValue> */
140 
141     /**
142      * Construct a AngularVelocityMatrix from a (sparse) collection of DoubleSparseValue objects. The displayUnit indicates the
143      * unit in which the values in the collection are expressed, as well as the unit in which they will be printed.
144      * @param data Collection&lt;DoubleSparseValue&gt;; the data for the matrix
145      * @param displayUnit AngularVelocityUnit; the display unit of the matrix data, and the unit of the data points
146      * @param rows int; the number of rows of the matrix
147      * @param cols int; the number of columns of the matrix
148      * @param storageType StorageType; the StorageType (SPARSE or DENSE) to use for constructing the Matrix
149      */
150     public AngularVelocityMatrix(final Collection<DoubleSparseValue<AngularVelocityUnit, AngularVelocity>> data,
151             final AngularVelocityUnit displayUnit, final int rows, final int cols, final StorageType storageType)
152     {
153         this(DoubleMatrixData.instantiate(data, rows, cols, storageType), displayUnit);
154     }
155 
156     /**
157      * Construct a AngularVelocityMatrix from a (sparse) collection of DoubleSparseValue objects. The displayUnit indicates the
158      * unit in which the values in the collection are expressed, as well as the unit in which they will be printed. Assume the
159      * storage type is SPARSE, since we offer the data as a collection.
160      * @param data Collection&lt;DoubleSparseValue&gt;; the data for the matrix
161      * @param displayUnit AngularVelocityUnit; the display unit of the matrix data, and the unit of the data points
162      * @param rows int; the number of rows of the matrix
163      * @param cols int; the number of columns of the matrix
164      */
165     public AngularVelocityMatrix(final Collection<DoubleSparseValue<AngularVelocityUnit, AngularVelocity>> data,
166             final AngularVelocityUnit displayUnit, final int rows, final int cols)
167     {
168         this(data, displayUnit, rows, cols, StorageType.SPARSE);
169     }
170 
171     /**
172      * Construct a AngularVelocityMatrix from a (sparse) collection of DoubleSparseValue objects. The displayUnit indicates the
173      * unit in which the values in the collection are expressed, as well as the unit in which they will be printed. Use the SI
174      * unit or base unit as the displayUnit.
175      * @param data Collection&lt;DoubleSparseValue&gt;; the data for the matrix
176      * @param rows int; the number of rows of the matrix
177      * @param cols int; the number of columns of the matrix
178      * @param storageType StorageType; the StorageType (SPARSE or DENSE) to use for constructing the Matrix
179      */
180     public AngularVelocityMatrix(final Collection<DoubleSparseValue<AngularVelocityUnit, AngularVelocity>> data, final int rows,
181             final int cols, final StorageType storageType)
182     {
183         this(data, AngularVelocityUnit.SI, rows, cols, storageType);
184     }
185 
186     /**
187      * Construct a AngularVelocityMatrix from a (sparse) collection of DoubleSparseValue objects. The displayUnit indicates the
188      * unit in which the values in the collection are expressed, as well as the unit in which they will be printed. Use the SI
189      * unit or base unit as the displayUnit. Assume the storage type is SPARSE, since we offer the data as a collection.
190      * @param data Collection&lt;DoubleSparseValue&gt;; the data for the matrix
191      * @param rows int; the number of rows of the matrix
192      * @param cols int; the number of columns of the matrix
193      */
194     public AngularVelocityMatrix(final Collection<DoubleSparseValue<AngularVelocityUnit, AngularVelocity>> data, final int rows,
195             final int cols)
196     {
197         this(data, AngularVelocityUnit.SI, rows, cols, StorageType.SPARSE);
198     }
199 
200     /** {@inheritDoc} */
201     @Override
202     public Class<AngularVelocity> getScalarClass()
203     {
204         return AngularVelocity.class;
205     }
206 
207     /** {@inheritDoc} */
208     @Override
209     public Class<AngularVelocityVector> getVectorClass()
210     {
211         return AngularVelocityVector.class;
212     }
213 
214     /** {@inheritDoc} */
215     @Override
216     public AngularVelocityMatrix instantiateMatrix(final DoubleMatrixData dmd, final AngularVelocityUnit displayUnit)
217     {
218         return new AngularVelocityMatrix(dmd, displayUnit);
219     }
220 
221     /** {@inheritDoc} */
222     @Override
223     public AngularVelocityVector instantiateVector(final DoubleVectorData dvd, final AngularVelocityUnit displayUnit)
224     {
225         return new AngularVelocityVector(dvd, displayUnit);
226     }
227 
228     /** {@inheritDoc} */
229     @Override
230     public AngularVelocity instantiateScalarSI(final double valueSI, final AngularVelocityUnit displayUnit)
231     {
232         AngularVelocity result = AngularVelocity.instantiateSI(valueSI);
233         result.setDisplayUnit(displayUnit);
234         return result;
235     }
236 
237 }