AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

pointer to an array in D und C++

Ein Thema von Virchov · begonnen am 19. Mär 2004 · letzter Beitrag vom 19. Mär 2004
Antwort Antwort
NicoDE
(Gast)

n/a Beiträge
 
#1

Re: pointer to an array in D und C++

  Alt 19. Mär 2004, 12:47
Zitat von Virchov:
Son Schheissforum!
Mäßige Dich bitte.

Delphi-Quellcode:
type
  PBooleanArray = ^TBooleanArray;
  TBooleanArray = array [0..High(Integer) - 1] of Boolean;

function BinImgMatchProMile(const BinImg1, BinImg2: TBooleanArray;
  nElements: Integer; out BinImgPlus, BinImgMinus: TBooleanArray): Integer;
  cdecl;
var
  idx: Integer;
  MatchCounter: Integer;
begin
  Result := 0;
  if (nElements > 0) then
  begin
    MatchCounter := 0;
    // calculations
    for idx := 0 to nElements - 1 do
    begin
      // local initialisation
      BinImgPlus[idx] := False;
      BinImgMinus[idx] := False;
      // Find out what to do for this element
      if BinImg1[idx] = BinImg2[idx] then
        // Got a match in case BinImg1 = BinImg2
        Inc(MatchCounter)
      else if BinImg1[idx] and not BinImg2[idx] then
        // Got positive difference in case BinImg1 > BinImg2
        BinImgPlus[idx] := True
      else if BinImg2[idx] and not BinImg1[idx] then
        // Got negatice difference in case BinImg1 < BinImg2
        BinImgMinus[idx] := True;
    end;
    Result := Int64(MatchCounter) * 1000 div nElements;
  end;
end;
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:53 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz