예제 #1
0
 /// <summary>
 /// Create a new diagonal matrix and initialize each diagonal value from the provided indexed enumerable.
 /// Keys must be provided at most once, zero is assumed if a key is omitted.
 /// This new matrix will be independent from the enumerable.
 /// A new memory block will be allocated for storing the matrix.
 /// </summary>
 public static DiagonalMatrix OfIndexedDiagonal(int rows, int columns, IEnumerable <Tuple <int, Complex> > diagonal)
 {
     return(new DiagonalMatrix(DiagonalMatrixStorage <Complex> .OfIndexedEnumerable(rows, columns, diagonal)));
 }
예제 #2
0
 /// <summary>
 /// Create a new diagonal matrix and initialize each diagonal value using the provided init function.
 /// </summary>
 public static DiagonalMatrix Create(int rows, int columns, Func <int, Complex> init)
 {
     return(new DiagonalMatrix(DiagonalMatrixStorage <Complex> .OfInit(rows, columns, init)));
 }
예제 #3
0
 /// <summary>
 /// Create a new diagonal matrix with diagonal values sampled from the provided random distribution.
 /// </summary>
 public static DiagonalMatrix CreateRandom(int rows, int columns, IContinuousDistribution distribution)
 {
     return(new DiagonalMatrix(DiagonalMatrixStorage <double> .OfInit(rows, columns,
                                                                      i => distribution.Sample())));
 }
예제 #4
0
 /// <summary>
 /// Create a new diagonal matrix as a copy of the given other matrix.
 /// This new matrix will be independent from the other matrix.
 /// The matrix to copy from must be diagonal as well.
 /// A new memory block will be allocated for storing the matrix.
 /// </summary>
 public static DiagonalMatrix OfMatrix(Matrix <Complex> matrix)
 {
     return(new DiagonalMatrix(DiagonalMatrixStorage <Complex> .OfMatrix(matrix.Storage)));
 }
예제 #5
0
 /// <summary>
 /// Create a new diagonal matrix straight from an initialized matrix storage instance.
 /// The storage is used directly without copying.
 /// Intended for advanced scenarios where you're working directly with
 /// storage for performance or interop reasons.
 /// </summary>
 public DiagonalMatrix(DiagonalMatrixStorage <float> storage)
     : base(storage)
 {
     _data = storage.Data;
 }
예제 #6
0
 /// <summary>
 /// Create a new diagonal matrix as a copy of the given two-dimensional array.
 /// This new matrix will be independent from the provided array.
 /// The array to copy from must be diagonal as well.
 /// A new memory block will be allocated for storing the matrix.
 /// </summary>
 public static DiagonalMatrix OfArray(double[,] array)
 {
     return(new DiagonalMatrix(DiagonalMatrixStorage <double> .OfArray(array)));
 }
 public override Matrix <double> Diagonal(DiagonalMatrixStorage <double> storage)
 {
     return(new DiagonalMatrix(storage));
 }
예제 #8
0
 public DiagonalMatrix(Matrix <double> matrix)
     : this(DiagonalMatrixStorage <double> .OfMatrix(matrix.Storage))
 {
 }
예제 #9
0
 public DiagonalMatrix(Matrix <float> matrix)
     : this(DiagonalMatrixStorage <float> .OfMatrix(matrix.Storage))
 {
 }
 /// <summary>
 ///     Create a new diagonal matrix straight from an initialized matrix storage instance.
 ///     The storage is used directly without copying.
 ///     Intended for advanced scenarios where you're working directly with
 ///     storage for performance or interop reasons.
 /// </summary>
 public abstract Matrix <T> Diagonal(DiagonalMatrixStorage <T> storage);
예제 #11
0
 public DiagonalMatrix(float[,] array)
     : this(DiagonalMatrixStorage <float> .OfArray(array))
 {
 }
 internal DiagonalMatrix(DiagonalMatrixStorage <float> storage)
     : base(storage)
 {
     _storage = storage;
     _data    = _storage.Data;
 }
예제 #13
0
 internal DiagonalMatrix(DiagonalMatrixStorage <Complex> storage)
     : base(storage)
 {
     _storage = storage;
     _data    = _storage.Data;
 }
예제 #14
0
 /// <summary>
 /// Create a new diagonal matrix straight from an initialized matrix storage instance.
 /// The storage is used directly without copying.
 /// Intended for advanced scenarios where you're working directly with
 /// storage for performance or interop reasons.
 /// </summary>
 public DiagonalMatrix(DiagonalMatrixStorage <Complex> storage)
     : base(storage)
 {
     _data = storage.Data;
 }
예제 #15
0
 return(new DiagonalMatrix(DiagonalMatrixStorage <float> .OfIndexedEnumerable(rows, columns, diagonal)));
 /// <summary>
 /// Create a new diagonal matrix straight from an initialized matrix storage instance.
 /// The storage is used directly without copying.
 /// Intended for advanced scenarios where you're working directly with
 /// storage for performance or interop reasons.
 /// </summary>
 public DiagonalMatrix(DiagonalMatrixStorage<Complex> storage)
     : base(storage)
 {
     _storage = storage;
     _data = _storage.Data;
 }
예제 #17
0
 /// <summary>
 /// Create a new diagonal matrix straight from an initialized matrix storage instance.
 /// The storage is used directly without copying.
 /// Intended for advanced scenarios where you're working directly with
 /// storage for performance or interop reasons.
 /// </summary>
 public DiagonalMatrix(DiagonalMatrixStorage<float> storage)
     : base(storage)
 {
     _data = storage.Data;
 }
예제 #18
0
 /// <summary>
 /// Create a new diagonal matrix as a copy of the given two-dimensional array.
 /// This new matrix will be independent from the provided array.
 /// The array to copy from must be diagonal as well.
 /// A new memory block will be allocated for storing the matrix.
 /// </summary>
 public static DiagonalMatrix OfArray(float[,] array)
 {
     return(new DiagonalMatrix(DiagonalMatrixStorage <float> .OfArray(array)));
 }
예제 #19
0
 /// <summary>
 /// Create a new diagonal matrix straight from an initialized matrix storage instance.
 /// The storage is used directly without copying.
 /// Intended for advanced scenarios where you're working directly with
 /// storage for performance or interop reasons.
 /// </summary>
 public DiagonalMatrix(DiagonalMatrixStorage<Complex32> storage)
     : base(storage)
 {
     _data = storage.Data;
 }
예제 #20
0
 /// <summary>
 /// Create a new diagonal matrix as a copy of the given other matrix.
 /// This new matrix will be independent from the other matrix.
 /// The matrix to copy from must be diagonal as well.
 /// A new memory block will be allocated for storing the matrix.
 /// </summary>
 public static DiagonalMatrix OfMatrix(Matrix <double> matrix)
 {
     return(new DiagonalMatrix(DiagonalMatrixStorage <double> .OfMatrix(matrix.Storage)));
 }
예제 #21
0
 /// <summary>
 /// Create a new diagonal matrix with diagonal values sampled from the provided random distribution.
 /// </summary>
 public static DiagonalMatrix CreateRandom(int rows, int columns, IContinuousDistribution distribution)
 {
     return(new DiagonalMatrix(DiagonalMatrixStorage <Complex32> .OfInit(rows, columns,
                                                                         i => new Complex32((float)distribution.Sample(), (float)distribution.Sample()))));
 }
예제 #22
0
 /// <summary>
 /// Create a new square sparse identity matrix where each diagonal value is set to One.
 /// </summary>
 public static DiagonalMatrix CreateIdentity(int order)
 {
     return(new DiagonalMatrix(DiagonalMatrixStorage <double> .OfInit(order, order, i => One)));
 }
예제 #23
0
 /// <summary>
 /// Create a new diagonal matrix straight from an initialized matrix storage instance.
 /// The storage is used directly without copying.
 /// Intended for advanced scenarios where you're working directly with
 /// storage for performance or interop reasons.
 /// </summary>
 public DiagonalMatrix(DiagonalMatrixStorage <Complex32> storage)
     : base(storage)
 {
     _storage = storage;
     _data    = _storage.Data;
 }
예제 #24
0
 /// <summary>
 /// Create a new diagonal matrix straight from an initialized matrix storage instance.
 /// The storage is used directly without copying.
 /// Intended for advanced scenarios where you're working directly with
 /// storage for performance or interop reasons.
 /// </summary>
 public DiagonalMatrix(DiagonalMatrixStorage <double> storage)
     : base(storage)
 {
     _storage = storage;
     _data    = _storage.Data;
 }
예제 #25
0
 public DiagonalMatrix(Complex[,] array)
     : this(DiagonalMatrixStorage <Complex> .OfArray(array))
 {
 }
예제 #26
0
 /// <summary>
 /// Create a new diagonal matrix as a copy of the given two-dimensional array.
 /// This new matrix will be independent from the provided array.
 /// The array to copy from must be diagonal as well.
 /// A new memory block will be allocated for storing the matrix.
 /// </summary>
 public static DiagonalMatrix OfArray(Complex[,] array)
 {
     return(new DiagonalMatrix(DiagonalMatrixStorage <Complex> .OfArray(array)));
 }
예제 #27
0
 public DiagonalMatrix(Matrix <Complex> matrix)
     : this(DiagonalMatrixStorage <Complex> .OfMatrix(matrix.Storage))
 {
 }
예제 #28
0
 /// <summary>
 /// Create a new diagonal matrix and initialize each diagonal value from the provided enumerable.
 /// This new matrix will be independent from the enumerable.
 /// A new memory block will be allocated for storing the matrix.
 /// </summary>
 public static DiagonalMatrix OfDiagonal(int rows, int columns, IEnumerable <Complex> diagonal)
 {
     return(new DiagonalMatrix(DiagonalMatrixStorage <Complex> .OfEnumerable(rows, columns, diagonal)));
 }
예제 #29
0
 /// <summary>
 /// Create a new diagonal matrix straight from an initialized matrix storage instance.
 /// The storage is used directly without copying.
 /// Intended for advanced scenarios where you're working directly with
 /// storage for performance or interop reasons.
 /// </summary>
 public static Matrix <T> Diagonal <T>(DiagonalMatrixStorage <T> storage)
     where T : struct, IEquatable <T>, IFormattable
 {
     return(Matrix <T> .Build.Diagonal(storage));
 }
예제 #30
0
 /// <summary>
 /// Create a new square sparse identity matrix where each diagonal value is set to One.
 /// </summary>
 public static DiagonalMatrix CreateIdentity(int order)
 {
     return(new DiagonalMatrix(DiagonalMatrixStorage <Complex> .OfValue(order, order, One)));
 }
예제 #31
0
 internal DiagonalMatrix(DiagonalMatrixStorage<Complex32> storage)
     : base(storage)
 {
     _storage = storage;
     _data = _storage.Data;
 }
예제 #32
0
 internal DiagonalMatrix(DiagonalMatrixStorage<float> storage)
     : base(storage)
 {
     _storage = storage;
     _data = _storage.Data;
 }
예제 #33
0
 /// <summary>
 /// Create a new diagonal matrix as a copy of the given other matrix.
 /// This new matrix will be independent from the other matrix.
 /// The matrix to copy from must be diagonal as well.
 /// A new memory block will be allocated for storing the matrix.
 /// </summary>
 public static DiagonalMatrix OfMatrix(Matrix <float> matrix)
 {
     return(new DiagonalMatrix(DiagonalMatrixStorage <float> .OfMatrix(matrix.Storage)));
 }
예제 #34
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DiagonalMatrix"/> class.
 /// </summary>
 public DiagonalMatrix(DiagonalMatrixStorage<double> storage)
     : base(storage)
 {
     _storage = storage;
     _data = _storage.Data;
 }
예제 #35
0
 public DiagonalMatrix(double[,] array)
     : this(DiagonalMatrixStorage <double> .OfArray(array))
 {
 }