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