public void Dense() { var result = matrixBuilder.Dense(2, 1, 10); result.Storage.Should().HaveCount(2); result[0, 0].Should().Be(10); result[1, 0].Should().Be(10); }
private IMatrix GetMatrixToBeCalculated(IMatrix topHorizon) { //Constructs the base horizon by adding a scalar to all values from top horizon var baseHorizon = topHorizon.Add(BaseHorizonOffset * Constants.FeetsInMeter); //create horizon for fluid contact var fluidContact = matrixBuilder.Dense(topHorizon.RowCount, topHorizon.ColumnCount, FluidContactDepth * Constants.FeetsInMeter); //create another horizon by comparing the fluid with base and choosing the minimum. var thresholdSurface = fluidContact.PointwiseMinimum(baseHorizon); //create a matrix to hold the distances between top and the threshold, negative values will be ignored during calculating the volume var distanceBetweenSurfaces = thresholdSurface.Subtract(topHorizon); return(distanceBetweenSurfaces); }