cern.colt.matrix.tfcomplex
Class FComplexFactory1D
- java.lang.Object
-
- cern.colt.PersistentObject
-
- cern.colt.matrix.tfcomplex.FComplexFactory1D
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class FComplexFactory1D extends PersistentObject
Factory for convenient construction of 1-d matrices holding complex cells. Use idioms like ComplexFactory1D.dense.make(1000) to construct dense matrices, ComplexFactory1D.sparse.make(1000) to construct sparse matrices. If the factory is used frequently it might be useful to streamline the notation. For example by aliasing:ComplexFactory1D F = ComplexFactory1D.dense; F.make(1000); F.random(3); ...
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static FComplexFactory1DdenseA factory producing dense matrices.static FComplexFactory1DsparseA factory producing sparse matrices.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description FComplexMatrix1Dappend(FComplexMatrix1D A, FComplexMatrix1D B)C = A||B; Constructs a new matrix which is the concatenation of two other matrices.FComplexMatrix1Dmake(java.util.ArrayList<float[]> values)Constructs a matrix from the values of the given list.FComplexMatrix1Dmake(FComplexMatrix1D[] parts)Constructs a matrix which is the concatenation of all given parts.FComplexMatrix1Dmake(float[] values)Constructs a matrix with the given cell values.FComplexMatrix1Dmake(int size)Constructs a matrix with the given shape, each cell initialized with zero.FComplexMatrix1Dmake(int size, float[] initialValue)Constructs a matrix with the given shape, each cell initialized with the given value.FComplexMatrix1Drandom(int size)Constructs a matrix with uniformly distributed values in (0,1) (exclusive).FComplexMatrix1Drepeat(FComplexMatrix1D A, int repeat)C = A||A||..||A; Constructs a new matrix which is concatenated repeat times.FComplexMatrix1Dsample(int size, float[] value, float nonZeroFraction)Constructs a randomly sampled matrix with the given shape.java.util.ArrayList<float[]>toList(FComplexMatrix1D values)Constructs a list from the given matrix.-
Methods inherited from class cern.colt.PersistentObject
clone
-
-
-
-
Field Detail
-
dense
public static final FComplexFactory1D dense
A factory producing dense matrices.
-
sparse
public static final FComplexFactory1D sparse
A factory producing sparse matrices.
-
-
Method Detail
-
append
public FComplexMatrix1D append(FComplexMatrix1D A, FComplexMatrix1D B)
C = A||B; Constructs a new matrix which is the concatenation of two other matrices. Example: 0 1 append 3 4 --> 0 1 3 4.
-
make
public FComplexMatrix1D make(float[] values)
Constructs a matrix with the given cell values. 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 new matrix.
-
make
public FComplexMatrix1D make(FComplexMatrix1D[] parts)
Constructs a matrix which is the concatenation of all given parts. Cells are copied.
-
make
public FComplexMatrix1D make(int size)
Constructs a matrix with the given shape, each cell initialized with zero.
-
make
public FComplexMatrix1D make(int size, float[] initialValue)
Constructs a matrix with the given shape, each cell initialized with the given value.
-
make
public FComplexMatrix1D make(java.util.ArrayList<float[]> values)
Constructs a matrix from the values of the given list. 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 new matrix.- Returns:
- a new matrix.
-
random
public FComplexMatrix1D random(int size)
Constructs a matrix with uniformly distributed values in (0,1) (exclusive).
-
repeat
public FComplexMatrix1D repeat(FComplexMatrix1D A, int repeat)
C = A||A||..||A; Constructs a new matrix which is concatenated repeat times.
-
sample
public FComplexMatrix1D sample(int size, float[] value, float nonZeroFraction)
Constructs a randomly sampled matrix with the given shape. Randomly picks exactly Math.round(size*nonZeroFraction) cells and initializes them to value, all the rest will be initialized to zero. Note that this is not the same as setting each cell with probability nonZeroFraction to value.- Throws:
java.lang.IllegalArgumentException- if nonZeroFraction < 0 || nonZeroFraction > 1.- See Also:
FloatRandomSampler
-
toList
public java.util.ArrayList<float[]> toList(FComplexMatrix1D values)
Constructs a list from the given matrix. The values are copied. So subsequent changes in values are not reflected in the list, and vice-versa.- Parameters:
values- The values to be filled into the new list.- Returns:
- a new list.
-
-
DMelt 3.0 © DataMelt by jWork.ORG