Package cern.colt.matrix
Class DoubleFactory3D
java.lang.Object
cern.colt.PersistentObject
cern.colt.matrix.DoubleFactory3D
- All Implemented Interfaces:
Serializable
,Cloneable
Factory for convenient construction of 3-d matrices holding double cells.
Use idioms like DoubleFactory3D.dense.make(4,4,4) to construct dense matrices,
DoubleFactory3D.sparse.make(4,4,4) to construct sparse matrices.
If the factory is used frequently it might be useful to streamline the notation.
For example by aliasing:
DoubleFactory3D F = DoubleFactory3D.dense; F.make(4,4,4); F.descending(10,20,5); F.random(4,4,5); ... |
- Version:
- 1.0, 09/24/99
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DoubleFactory3D
A factory producing dense matrices.static final DoubleFactory3D
A factory producing sparse matrices.Fields inherited from class cern.colt.PersistentObject
serialVersionUID
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Makes this class non instantiable, but still let's others inherit from it. -
Method Summary
Modifier and TypeMethodDescriptionascending
(int slices, int rows, int columns) Constructs a matrix with cells having ascending values.descending
(int slices, int rows, int columns) Constructs a matrix with cells having descending values.make
(double[][][] values) Constructs a matrix with the given cell values.make
(int slices, int rows, int columns) Constructs a matrix with the given shape, each cell initialized with zero.make
(int slices, int rows, int columns, double initialValue) Constructs a matrix with the given shape, each cell initialized with the given value.random
(int slices, int rows, int columns) Constructs a matrix with uniformly distributed values in (0,1) (exclusive).Methods inherited from class cern.colt.PersistentObject
clone
-
Field Details
-
dense
A factory producing dense matrices. -
sparse
A factory producing sparse matrices.
-
-
Constructor Details
-
DoubleFactory3D
protected DoubleFactory3D()Makes this class non instantiable, but still let's others inherit from it.
-
-
Method Details
-
ascending
Constructs a matrix with cells having ascending values. For debugging purposes. -
descending
Constructs a matrix with cells having descending values. For debugging purposes. -
make
Constructs a matrix with the given cell values. values is required to have the form values[slice][row][column] and have exactly the same number of slices, rows and columns as the receiver.The values are copied. So subsequent changes in values are not reflected in the matrix, and vice-versa.
- Parameters:
values
- the values to be filled into the cells.- Returns:
- this (for convenience only).
- Throws:
IllegalArgumentException
- if values.length != slices() || for any 0 <= slice < slices(): values[slice].length != rows().IllegalArgumentException
- if for any 0 <= column < columns(): values[slice][row].length != columns().
-
make
Constructs a matrix with the given shape, each cell initialized with zero. -
make
Constructs a matrix with the given shape, each cell initialized with the given value. -
random
Constructs a matrix with uniformly distributed values in (0,1) (exclusive).
-