Einzelnen Beitrag anzeigen

bernhard_LA

Registriert seit: 8. Jun 2009
Ort: Bayern
1.124 Beiträge
 
Delphi 11 Alexandria
 
#1

Generic TArray und TList ...

  Alt 5. Jan 2024, 12:12
wie muss denn die Korrekte Definition eine Generischen TClusterList Liste
aussehen , mein Syntaxfehler aktuell : [dcc32 Error] Unit_TKmeans.pas(37): E2508 Type parameters not allowed on this type



Delphi-Quellcode:
  /// <summary>
  /// here it is just a simple pixel
  /// </summary>
  TClusterData = record
    DrawingColor: TColor;
    x,y : Integer;
  end;

  /// <summary>
  /// here it is just a simple pixel , we store the complete image as a pixel list
  /// </summary>
  TRowData = TArray< TClusterData>;


  /// <summary>
  /// store the data now inside a cluster with a Centroid
  /// </summary>
  TCluster<T> = record
     Center: TClusterData;
     ClusterElements : TArray<T>;
  end;

  /// <summary>
  /// the cluster list
  /// </summary>
  TClusterList<T> = TArray<TCluster<T>>;

  /// <summary>
  /// measure distance according to this function
  /// </summary
  TDistanceMetricfunction=reference to function(const A, B: TClusterData) : Double;
  Mit Zitat antworten Zitat