Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/TMG-Framework/Data/CategoryIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace TMG;
/// </summary>
public readonly struct CategoryIndex : IEquatable<CategoryIndex>, IComparable<CategoryIndex>, IEqualityComparer<CategoryIndex>
{
private readonly int _Value;
private readonly nint _Value;

public CategoryIndex(int value)
{
Expand All @@ -36,10 +36,14 @@ public CategoryIndex(int value)
/// </summary>
public bool Exists => _Value >= 0;

public static implicit operator int(CategoryIndex index) => index._Value;
public static implicit operator int(CategoryIndex index) => (int)index._Value;

public static implicit operator CategoryIndex(int index) => new(index);

public static implicit operator nuint(CategoryIndex index) => (nuint)index._Value;

public static implicit operator nint(CategoryIndex index) => index._Value;

public static bool TryParse(string s, out CategoryIndex result)
{
if (!int.TryParse(s, out int temp))
Expand Down
6 changes: 3 additions & 3 deletions src/TMG-Framework/Processing/Evaluate2DGravityModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ namespace TMG.Processing;
DocumentationLink = "http://tmg.utoronto.ca/doc/2.0")]
public sealed class Evaluate2DGravityModel : BaseFunction<Matrix>
{
[SubModule(Name = "Production", Required = true, Index = 0, Description = "")]
[SubModule(Name = "Production", Required = true, Index = 0, Description = "The production vector for the gravity model.")]
public IFunction<Vector> Production = null!;

[SubModule(Name = "Attraction", Required = true, Index = 1, Description = "")]
[SubModule(Name = "Attraction", Required = true, Index = 1, Description = "The attraction vector for the gravity model.")]
public IFunction<Vector> Attraction = null!;

[SubModule(Name = "Friction", Required = true, Index = 2, Description = "")]
[SubModule(Name = "Friction", Required = true, Index = 2, Description = "The friction matrix for the gravity model.")]
public IFunction<Matrix> Friction = null!;

[Parameter(Name = "Max Iterations", Index = 3, DefaultValue = "100", Description = "The maximum number of iterations before terminating.")]
Expand Down
Loading