• API Documentation
Show / Hide Table of Contents
  • Rebus
    • Arguments
    • Biome
    • CantorPairing
    • CommandRequest
    • CommandResponse
    • CommandType
    • Commodity
    • Configuration
    • ConflictEventArgs
    • Depths
    • Economy
    • Fleet
    • HexPoint
    • IGameService
    • ILoginService
    • Player
    • Unit
    • User
    • Zone
    • ZoneInfo
  • Rebus.Client
    • GraphicsEngine
    • Layout
    • RpcClient
    • ZoneVisualizer
  • Rebus.Client.Lenses
    • BiomeLens
    • ConstellationLens
    • Lens
    • PopulationLens
    • StarLens
  • Rebus.Server
    • AStarSearch
    • EvaluationContext
    • FisherYatesShuffle
    • JuliaSet
    • PowerSet
  • Rebus.Server.Considerations
    • Agent
    • Behavior
    • BehaviorCollection
    • Consideration
    • ConsiderationCollection
    • FunctionConsideration
    • LinearConsideration
    • QuadraticConsideration
  • Rebus.Server.Functions
    • IFunctions<T>
  • System
    • NegativeExponentialRandom
  • System.Text.Json.Serialization.Converters
    • ComplexConverter
    • CultureInfoConverter
    • IPAddressConverter

Class PowerSet

Provides a method to create a power set for a given set.

Inheritance
Object
PowerSet
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Rebus.Server
Assembly: Rebus.Server.dll
Syntax
public static class PowerSet
Remarks

The implementation of this class was inspired by and based on this Stack Overflow question asked by Jamal Hussain and answered by @SergeyS.

Methods

Create(IReadOnlyList<Int32>)

Creates a power set for the given values.

Declaration
public static int[][] Create(IReadOnlyList<int> values)
Parameters
Type Name Description
IReadOnlyList<Int32> values

The set of values.

Returns
Type Description
Int32[][]

The set containing every subset of the given set, including the empty set ({}) and the given set (values). The subsets are sorted in descending order based on their length.

See Also

c# - Creating a power set of a Sequence - Stack Overflow
Jamal Hussain - Stack Overflow
@SergeyS - Stack Overflow
In This Article
Back to top © 2021-2022 Ishan Pranav. All rights reserved. Licensed under the MIT License.