public static DoubleMatrix Dense(
int numberOfRows,
int numberOfColumns
)
Public Shared Function Dense (
numberOfRows As Integer,
numberOfColumns As Integer
) As DoubleMatrix
public:
static DoubleMatrix^ Dense(
int numberOfRows,
int numberOfColumns
)
static member Dense :
numberOfRows : int *
numberOfColumns : int -> DoubleMatrix
DoubleMatrix dense instances allocate storage for each matrix entry. Sparse DoubleMatrix instances can be created by calling method Sparse(Int32, Int32, Int32).
In the following example, a dense matrix is created having all its entries equal to zero.
using System;
namespace Novacta.Analytics.CodeExamples
{
public class DenseExample5
{
public void Main()
{
// Set matrix dimensions.
int numberOfRows = 3;
int numberOfColumns = 2;
// Create the matrix. All entries will be equal to zero.
var matrix = DoubleMatrix.Dense(
numberOfRows, numberOfColumns);
Console.WriteLine("Each entry is equal to zero.");
Console.WriteLine("The data matrix:");
Console.WriteLine(matrix);
}
}
}
// Executing method Main() produces the following output:
//
// Each entry is equal to zero.
// The data matrix:
// 0 0
// 0 0
// 0 0
//
//
ArgumentOutOfRangeException | numberOfRows is not positive. -or- numberOfColumns is not positive. |