-
Content Count
3586 -
Joined
-
Last visited
-
Days Won
176
Everything posted by David Heffernan
-
Delphi implementation of Aberth–Ehrlich method and precision problem
David Heffernan replied to at3s's topic in Algorithms, Data Structures and Class Design
I'd be astounded if that was not the case. Eigen has a very good reputation. Certainly for basic matrix arithmetic performance is excellent. And I'd be astonished if it could not match openblas for eigensolves. Then I don't know why you asked if it was possible to do something that you were already doing. -
Delphi implementation of Aberth–Ehrlich method and precision problem
David Heffernan replied to at3s's topic in Algorithms, Data Structures and Class Design
That isn't it. Not true. C++ compilers can perform just as well. Possible. But I doubt it. I bet you are asking different questions, and not comparing like with like. Quite simple to call libopenblas from delphi. I do just that. -
Delphi implementation of Aberth–Ehrlich method and precision problem
David Heffernan replied to at3s's topic in Algorithms, Data Structures and Class Design
OK, I see. We'll, I don't really know. It seems odd because they use the same algorithm as I understand it. I imagine there is a good explanation. But there'd need to be more detail. -
Delphi implementation of Aberth–Ehrlich method and precision problem
David Heffernan replied to at3s's topic in Algorithms, Data Structures and Class Design
Your lapack call does not calculate eigen vectors. The eigen call does. -
Delphi implementation of Aberth–Ehrlich method and precision problem
David Heffernan replied to at3s's topic in Algorithms, Data Structures and Class Design
That would be surprising. I wouldn't want to comment without seeing what options you used when calling the functions. -
Enums and generics
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Unless all of your enumerated types have the same names, it seems like you'd have to provide names for each type. -
Enums and generics
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
You have misunderstood me. The attribute is independent of the type. Therefore it can be used with any type. -
Enums and generics
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
As you can see from the code, the attribute class is called NamesAttribute and is independent from the type. Otherwise the whole thing would be pointless. -
Enums and generics
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
I do this; [Names( 'Curvature', 'Bend angle' )] TPreBendSpecifiedBy = ( pbsCurvature, pbsBendAngle ); and then I can write: Assert(Enum.Name(pbsCurvature) = 'Curvature')) Of course this requires some library code behind it, but it's pretty convenient. -
Boolean short-circuit with function calls
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
I can’t see past // must call all functions, defeat short circuit evaluation aVal := A(); bVal := B(); cVal := C(); Result := aVal or bVal or cVal; I don’t care for temporarily disabling short circuit evaluation. I’d rather have the predictability of one rule for expression evaluation. Mix and match adds an impedance to understanding for the reader. -
How to extend/add helpers to for record function?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Yes. This is what I said in my earlier comments. -
How to extend/add helpers to for record function?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
The helper is on the node. So you’d need to call vNode.ToInteger(‘Id’). I think you could do with a better name for the helper function. -
How to extend/add helpers to for record function?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
You have to pass the attribute name to the helper function. Also, don't call GetAttribute twice. Store the return value in a local variable. -
Delphi implementation of Aberth–Ehrlich method and precision problem
David Heffernan replied to at3s's topic in Algorithms, Data Structures and Class Design
ARPACK is recommended for extracting a small number of eigen vectors from a huge problem. LAPACK has effective methods for extracting all solutions using a direct method. Neither are easy to use from Delphi. I have done so but it isn't for the faint of heart. Especially ARPACK. The famous C++ Eigen library is very capable though and easy to use. I'd suggest you wrap that in a DLL. Start in Matlab to prove that it can do the calculation sufficiently quickly for a typical matrix that you will work with. Then write a C++ program in Eigen to solve the same problems. Does that work effectively? Then, and only then, try to wrap it up to be called from Delphi. -
Delphi implementation of Aberth–Ehrlich method and precision problem
David Heffernan replied to at3s's topic in Algorithms, Data Structures and Class Design
It wasn't aimed at the OP. It was aimed at all the misleading posters who guessed and speculated. In my opinion it is those posts that are harmful to the OP's chance of progress. This topic requires knowledge of numerical methods for solving eigenproblems. Most of the posts have not lived up to that. -
Delphi implementation of Aberth–Ehrlich method and precision problem
David Heffernan replied to at3s's topic in Algorithms, Data Structures and Class Design
Why does anybody think that all this guessing would be useful? Does anybody have much experience of success when guessing? Solving eigen problems is a very challenging numerical problem. Does anybody really believe that good solutions arise from guesswork? I am frankly embarrassed by this thread. -
Delphi implementation of Aberth–Ehrlich method and precision problem
David Heffernan replied to at3s's topic in Algorithms, Data Structures and Class Design
It is practical. It is routine to solve eigen problems for systems of thousands of variables. -
Delphi implementation of Aberth–Ehrlich method and precision problem
David Heffernan replied to at3s's topic in Algorithms, Data Structures and Class Design
@Kas Ob.It's pointless trying to argue about making the wrong solution work. -
Delphi implementation of Aberth–Ehrlich method and precision problem
David Heffernan replied to at3s's topic in Algorithms, Data Structures and Class Design
Try other compilers isn't going to make any difference here. Other compilers will face the same problems. I am reasonably confident that the correct way forward is to use the right tool for the job. And root finding of the characteristic polynomial is not the way to find eigenvalues on a finite computer. -
Delphi implementation of Aberth–Ehrlich method and precision problem
David Heffernan replied to at3s's topic in Algorithms, Data Structures and Class Design
If your goal is to find eigenvalues then you should use a dedicated library for that. There are a good few about that can handle matrices with sizes in the thousands. It sounds like you are trying to find roots of the characteristic polynomial. This is not a robust approach. -
System.GetMemory returning NIL
David Heffernan replied to dummzeuch's topic in RTL and Delphi Object Pascal
I don't need to. I'm not the one making the claim that all huge memory allocations should be made using VirtualAlloc. It's you that is making that claim. -
When can Class.Create fail?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Well not necessarily. Typically you let exceptions float upwards to be handled by some high level exception handler. -
System.GetMemory returning NIL
David Heffernan replied to dummzeuch's topic in RTL and Delphi Object Pascal
Not obvious at all. Usually you allocated memory because you wanted to use it. If you've swapped the entire block to disk then bringing a couple of pages back is the least of your worries. Solve your problem by avoiding swapping in the first place. Nothing you have said, in my view, supports your claim that all allocation of huge blocks should be done using VirtualAlloc. -
System.GetMemory returning NIL
David Heffernan replied to dummzeuch's topic in RTL and Delphi Object Pascal
I don't see any benchmark to support the assertion that all allocation of huge blocks should be done using VirtualAlloc. Can you point to it. -
System.GetMemory returning NIL
David Heffernan replied to dummzeuch's topic in RTL and Delphi Object Pascal
A valid benchmark from a real world program would make me consider what I said.