• 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 CantorPairing

Provides an implementation of the Cantor pairing function. This class cannot be inherited.

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

The function in this class comes from this Wikipedia article.

Methods

Pair(Int32, Int32)

Assigns a natural number to the pair of natural numbers.

Declaration
public static int Pair(int value1, int value2)
Parameters
Type Name Description
Int32 value1

The first natural number.

Int32 value2

The second natural number.

Returns
Type Description
Int32

A natural number unique to the pair of value1 and value2.

See Also

Pairing function - Wikipedia
In This Article
Back to top © 2021-2022 Ishan Pranav. All rights reserved. Licensed under the MIT License.