NRect

Class which is used to implement N dimensional Hyperrectangles.

NRect

Bases: domain

Class for solving purely spatial problems on N dimensional hyperrectangles

__init__(dim, xmins, xmaxs)

Constructor for class

Parameters:
  • dim (int) –

    Spatial dimension of domain.

  • xmins (list) –

    Minimum values along each dimension, e.g, [-1, -1].

  • xmaxs (list) –

    Maximum values along each dimension, e.g, [1, 1].

isInside(point)

Parameters:
  • point (list) –

    Point in spatial dimensions of the hyperrectangle

Returns:
  • bool

    True if point is interior to the hyperrectangle, False otherwise

onBoundary(point)

Parameters:
  • point (list) –

    Point in spatial dimensions of the hyperrectangle

Returns:
  • bool

    True if point is on the boundary of the hyperrectangle, False otherwise

sampleBoundary(n_bc)

Samples boundary of hyperrectangle.

Parameters:
  • n_bc (int) –

    Number of points to sample in the boundary.

Returns:
  • tensor

    Sampled boundary points.

sampleDomain(n_clp)

Samples interior of hyperrectangle.

Parameters:
  • n_clp (int) –

    Number of points to sample in the interior of the ellipsoid.

Returns:
  • tensor

    Sampled interior points.