AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Delphi-PRAXiS - Lounge Klatsch und Tratsch LM Studio mit deepseek-r1-distill-qwen-7b
Thema durchsuchen
Ansicht
Themen-Optionen

LM Studio mit deepseek-r1-distill-qwen-7b

Ein Thema von dummzeuch · begonnen am 2. Apr 2025 · letzter Beitrag vom 5. Apr 2025
 
Benutzerbild von dummzeuch
dummzeuch
Online

Registriert seit: 11. Aug 2012
Ort: Essen
1.734 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#5

AW: LM Studio mit deepseek-r1-distill-qwen-7b

  Alt 2. Apr 2025, 18:03
Ich habe es jetzt hinbekommen, die "KI" in die IDE einzubinden. Jeder Aufruf dauert natürlich ewig, weil der PC dafür schlicht nicht geeignet ist. Aber es funktioniert.

Blöd ist, dass während sie auf die Antwort wartet, die IDE komplett blockiert ist. Ich will mir als Test gerade eine InsertionSort Implementation erklären lassen und hätte jetzt gerne den Sourcecode hier rein kopiert.

Edit: So, die Antwort ist da.

Code, der zu erklären war:

Delphi-Quellcode:
procedure SomeSort(Left, Right: Integer; CompareFunc: TCompareFunction; SwapProc: TSwapProcedure);
var
  I, J: Integer;
begin
  for I := Left + 1 to Right do begin
    J := I;
    while (J > Left) and (CompareFunc(J - 1, J) > 0) do begin
      SwapProc(J - 1, J);
      Dec(J);
    end;
  end;
end;
Erklärung

Zitat:
The code provided is
an implementation of the **bubble sort** algorithm tailored to use custom comparison and swap
functions. Here's a step-by-step explanation:

1. **Procedure Definition**: `SomeSort` takes four
parameters: two integers (`Left` and `Right`) defining the range of indices, a function pointer
`CompareFunc`, and a procedure pointer `SwapProc`.

2. **Loop Structure**:
- The outer loop
runs from `Left + 1` to `Right`, setting an index `I` for each iteration.
- For each `I`,
initialize another index `J` to `I`.

3. **Comparison and Swapping**:
- A while loop checks if
`J` is greater than `Left` and if `CompareFunc(J-1, J)` returns a positive value, indicating
elements at positions `J-1` and `J` are out of order.
- If conditions are met, swap the elements
using `SwapProc`, then decrement `J`.

4. **Termination**:
- The process continues until all
elements in the specified range are sorted according to the comparison logic defined by
`CompareFunc`.

This implementation is akin to a custom bubble sort that uses user-defined
functions for comparisons and swaps, ensuring flexibility in sorting criteria while maintaining an
in-place sorting mechanism.
Hm, Ich bin auch da nicht wirklich überzeugt.
Thomas Mueller

Geändert von dummzeuch ( 2. Apr 2025 um 18:14 Uhr)
  Mit Zitat antworten Zitat
 


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 11:01 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-2025 by Thomas Breitkreuz