Free cookie consent management tool by TermsFeed Policy Generator

source: branches/Persistence Test/ALGLIB/faq.english.html @ 3810

Last change on this file since 3810 was 2430, checked in by gkronber, 15 years ago

Moved ALGLIB code into a separate plugin. #783

File size: 15.6 KB
Line 
1<html>
2<head>
3
4<title>ALGLIB FAQ</title>
5<style type="text/css">
6<!--
7h1 { font-family: Tahoma,sans-serif; font-size : larger; }
8h2 { font-family: Arial,sans-serif; font-size : 11pt; }
9h3 { font-family: Arial,sans-serif; font-size : 9pt; }
10.cond  { color:blue; }
11.const { color:#222222; }
12.func  { color:#111111; }
13.smalltext { font-size : 10pt; }
14-->
15</style>
16</head>
17<body>
18
19<p align=justify>
20<b>C++</b><br>
21<span class=smalltext>
22<a href="#stdafx">What is the blank file <code>stdafx.h</code> here for?</a><br>
23<a href="#cpparrays">How is the array operations organized in C++?</a><br>
24<a href="#cpparrays2">Why are round brackets used when addressing arrays, not square brackets?</a><br>
25<a href="#cpp64">Will the ALGLIB package work in 64-bit environment?</a><br>
26</span><br>
27
28<b>Delphi</b><br>
29
30<span class=smalltext>
31<a href="#forwhile">Why is <i>while</i> cycle used instead of the <i>for</i> cycle?</a><br>
32<a href="#dac">What is the purpose of the <code>DynamicArrayCopy</code> function?</a><br>
33</span><br>
34
35<b>Visual Basic</b><br>
36
37<span class=smalltext>
38<a href="#vbver">What version of Visual Basic are the algorithms translated into?</a><br>
39<a href="#vbnet">Will the programs from the site work in VB.NET?</a><br>
40<a href="#vbgoto">Why is the <i>goto</i> operator used in some programs?</a><br>
41</span><br>
42
43<b>General Questions on source codes</b><br>
44
45<span class=smalltext>
46<a href="#reliability">How reliable is the ALGLIB package?</a><br>
47<a href="#ap">What is the AP library?</a><br>
48<a href="#ablas">What is the ABLAS library?</a><br>
49<a href="#statuses">What do module statuses (experimental, development, stable, obsolete) mean?</a><br>
50<a href="#stablevsfull">What is the difference between alglib.stable and alglib.full archives?</a><br>
51<a href="#rcomm">Why do some algorithms (for instance, optimization methods) use reverse communication instead of function pointers, delegates and other means of my programming language?</a><br>
52</span><br>
53
54<b>General questions</b><br>
55
56<span class=smalltext>
57<a href="#project">What is ALGLIB aimed at?</a><br>
58<a href="#diff">What is the difference between ALGLIB and other similar projects?</a><br>
59<a href="#authors">Who are the authors of the ALGLIB?</a><br>
60<a href="#rus">What relation does the website have to Russia?</a><br>
61<a href="#algopascal">What is AlgoPascal?</a><br>
62<a href="#other">Where can I find the algorithms for the work with files, drawing pictures in OpenGL, etc?</a><br>
63</span><br>
64</p>
65
66<hr width=80% size=1>
67
68<h1>C++</h1>
69<a name=stdafx><h2>What is the blank file <code>stdafx.h</code> here for?</h2></a>
70
71<p align=justify>
72MSVC and some other compilers require the <code>#include &lt;stdafx.h&gt;</code> directive in the program code to manage precompiled headers, and create the stfafx.h file when generating a new project. However, some compilers (e.g. BCB) use other tools to manage precompiled headers. In this case the <code>#include &lt;stdafx.h&gt;</code> directive as such doesn't hinder their operation, however if the file with this name is absent, a compilation error occurs. The blank file called <code>stfafx.h</code> is created to avoid this error. If your development environment already created the file, leave it unchanged.
73</p>
74
75<a name=cpparrays><h2>How is the array operations organized in C++?</h2></a>
76
77<p align=justify>
78As there is no dynamic array support in C++ (<b>update:</b> <i>I know about pointers and dynamic memory allocation, but this is not exactly the thing we need here</i>), template classes were developed to work with one- and two-dimensional arrays. The necessary source code and description can be found in the standard AP library, which is supplied with ALGLIB sources. Please note that the array numeration in this library begins from any number the programmer chooses rather than from 0.
79</p>
80
81<a name=cpparrays2><h2>Why are round brackets used when addressing arrays, not square brackets?</h2></a>
82
83<p align=justify>
84Imagine you are addressing the a matrix element in the common notation: <code>a[x][y]</code> instead of <code>a(x,y)</code>. Actually there are two index operators called here instead of one. The first is indexing of a matrix by <code>x</code>, that returns a reference to a temporary structure that describes the matrix row. The second is indexing that temporary structure by <code>y</code>, which returns the reference to the needed element. Addressing through overloading the round brackets is much more effective, as no temporary structures are required.
85</p>
86
87<a name=cpp64><h2>Will the ALGLIB package work in 64-bit environment?</h2></a>
88
89<p align=justify>
90The ALGLIB package was not tested in 64-bit environment.
91</p>
92
93<p align=justify>
94However, the package itself and the AP/C++ library it uses don't contain any code that explicitly points out the environment it should work in. Thus, in theory compiling and usage of ALGLIB package in a 64-bit environment should not cause any trouble when not using additional libraries (like ABLAS, which is at the moment intended to work only in 32-bit environments).
95</p>
96
97<h1>Delphi</h1>
98
99<a name=forwhile><h2>Why is <i>while</i> cycle used instead of the <i>for</i> cycle?</h2></a>
100
101<p align=justify>
102The reason for that is some peculiarities of the <b>for</b> cycle in Delphi. If the cycle has not been executed yet, in many programming languages the control variable of the cycle contains the initial value. In Delphi, if the cycle has not been executed, the control variable of the cycle doesn't change. Once I have seen a source code, in which this difference played a major role. That's why decided to replace the <b>for</b> cycle in Delphi with <b>while</b> cycle, whose behavior is the same as in any other language.
103</p>
104
105<a name=dac><h2>What is the purpose of the <code>DynamicArrayCopy</code> function?</h2></a>
106
107<p align=justify>
108In Delphi dynamic arrays are reference types, i.e. if the array parameter is passed by value, no copying of the array occurs. To emulate the transfer of the array parameter by value we use the <code>DynamicArrayCopy</code> function. It requires a dynamic array as an argument and returns a copy of this array. Assignment of the type <code>A:=DynamicArrayCopy(A)</code> replaces the reference to the original array with a reference to its copy.
109</p>
110
111<h1>Visual Basic</h1>
112
113<a name=vbver><h2>What version of Visual Basic are the algorithms translated into?</h2></a>
114
115<p align=justify>
116The algorithms are translated into VBA, but in general are compatible with VB6.
117</p>
118
119<a name=vbnet><h2>Will the programs from the site work in VB.NET?</h2></a>
120
121<p align=justify>
122Not unless they are manually ported.
123</p>
124
125<a name=vbgoto><h2>Why is the <i>goto</i> operator used in some programs?</h2></a>
126
127<p align=justify>
128In many programming languages there is control operator <b>continue</b>, but it is absent in VB. In AlgoPascal, this operator appears from time to time. The <b>goto</b> operator is used to replace it and go to the next iteration of the cycle.
129</p>
130
131<h1>General Questions on source codes</h1>
132
133<a name=reliability><h2>How reliable is the ALGLIB package?</h2></a>
134
135<p align=justify>
136The following measures are taken to ensure the reliability of the ALGLIB package:
137</p>
138
139<ul>
140<li>
141testing of package algorithms. All modules that have 'development' or 'stable' status have unit tests. Testing of ALGLIB for C#, C++, C++ (multiple precision) and Delphi is carried out automatically. Unfortunately the VBA version is tested manually and not completely, as VBA programs cannot be launched from command line. To compensate for this, the VBA version is actively used to develop new programs, which allows for counting on its stability.
142</li>
143<li>
144a clear specification of modules limitations.
145</li>
146<li>
147a clear differentiation between stably working modules tested by unit tests and time and experimental modules, where the stability is not tested adequately.
148</li>
149<li>
150transparent bug registration and correction processes.
151</li>
152</ul>
153
154<a name=ap><h2>What is the AP library?</h2></a>
155
156<p align=justify>
157AP library is a generic name for a set of libraries in several programming languages performing low-level tasks depending on specific programming languages. The AP library carries out tasks such as working with dynamic one- and multidimensional arrays in languages which do not support this data type, contains implementation of basic linear algebra algorithms, etc. The library is distributed as source codes under GPL 2+ license (GPL 2 or later). The library is attached to each algorithm package available for downloading from the web-site. The latest library version is available for downloading from <a href="http://alglib.sources.ru/translator/aplib.zip">http://alglib.sources.ru/translator/aplib.zip</a>
158</p>
159
160<a name=ablas><h2>What is the ABLAS library?</h2></a>
161
162<p align=justify>
163ABLAS is an optimized implementation of basic linear algebra subroutines written in assembler. To use ABLAS it is necessary to copy the DLL file to one of the system folders or in the program folder and turn on ABLAS support (as described in ABLAS manual). When launching a program that is using the ALGLIB package, the ABLAS library is automatically detected and loaded. If ABLAS is absent, the program uses the standard implementation of linear algebra operations, written in a high-level language. At <a href="http://www,alglib.net/projects/ablas/">http://www,alglib.net/projects/ablas/</a> (or <a href="http://alglib.sources.ru/projects/ablas/">http://alglib.sources.ru/projects/ablas/</a> in Russian) there is library description, the list of the supported platforms and programming languages as well as source code and precompiled binary files.
164</p>
165
166<a name=stablevsfull><h2>What is the difference between alglib.stable and alglib.full archives?</h2></a>
167
168<p align=justify>
169A 'stable' archive contains only 'stable' modules . A 'full' archive also contains modules with 'experimental' and 'development' status.
170</p>
171
172<a name=statuses><h2>What do module statuses (experimental, development, stable, obsolete) mean?</h2></a>
173
174<p align=justify>
175Modules included into ALGLIB can have a different status depending on the lifecycle stage they are in:
176</p>
177
178<ul>
179<li>
180<B>experimental</B> - the module is experimental and its stability is not guaranteed. It cannot be used in the programs where high level of reliability is a requirement, but still can be useful for library users. You can use it at your own discretion - for instance, for educational purposes. This status is assigned very rarely and only when an unstable module is still better than no module at all.
181</li>
182<li>
183<B>development</B> - the module is usable, there are no stability issues, but the API that is offered is not yet a hundred per cent completed. It is possible that in future versions of ALGLIB the module will be changed in the manner not compatible with the previous version. This status is assigned pretty seldom and only to new modules.
184</li>
185<li>
186<B>stable</B> - the module is usable, there are no stability issues, the API that is offered is absolutely done and will not change. Most often the modules are openly published only after they are assigned 'stable' status.
187</li>
188<li>
189<B>obsolete</B> - the module is not supported anymore and not included in the ALGLIB releases.
190</li>
191</ul>
192
193<a name=rcomm><h2>Why do some algorithms (for instance, optimization methods) use reverse communication instead of function pointers, delegates and other means of my programming language?</h2></a>
194
195<p align=justify>
196Optimization, integration and other similar methods are united by one common trait. They need to have a way of calculating the meaning of a function defined by the <I>user</I> at a point defined by the <I>method</I>.
197</p>
198
199<p align=justify>
200The most convenient way of solving this problem is transferring a function pointer into the module. However bear in mind that ALGLIB package is written using pseudo code that is automatically translated into different programming languages. While each language has its own function pointer analog that is often different from other languages. When the ALGLIB pseudo code was developed, at some point is became clear that adding function pointers in it will be very complex as this feature is implemented differently in every language. This is why reverse communication was chosen as a different kind of solution.
201</p>
202
203<h1>General questions</h1>
204
205<a name=project><h2>What is ALGLIB aimed at?</h2></a>
206
207<p align=justify>
208It is mostly aimed at creating a convenient and efficient multilingual scientific software library.
209</p>
210
211<a name=diff><h2>What is the difference between ALGLIB and other similar projects?</h2></a>
212
213<p align=justify>
214The ALGLIB package:
215</p>
216
217<ul>
218<li>is a multilingual project. The main feature of the project is that each algorithm is represented by programs in several languages and the language list is the same for every algorithm. This is the main advantage of the site before other similar collections - one algorithm, several languages, identical functionality in each language.</li>
219<li>is a collection of programs. Sometimes visitors complain that there are practically no algorithm descriptions at the site. Yes, that's true - just because ALGLIB is a collection of programs, not the used algorithm descriptions. Unfortunately we cannot do everything.</li>
220<li>is focused on numerical analysis. There are some other directions in the project (for instance, there are algorithms for sorting and graphics) but numerical analysis is a priority.</li>
221<li>is easy to use. To use the ALGLIB package you don't need to learn an unknown programming language, attach additional external libraries or work with an extensive and inconvenient interface to a code written in another programming language.</li>
222</ul>
223
224<p align=justify>
225Now on what ALGLIB is not and is not going to be. ALGLIB doesn't:
226</p>
227
228<ul>
229<li>compete with specialized projects. This is not the goal. And, however hard I try, the project won't get as fast as MKL or have as wide a functionality as LAPACK.</li>
230<li>go out of the boundaries of the project. For instance, parallel calculations are very interesting, but the solution of this problem is usually tightly connected to a certain platform, programming environment or language, which doesn't align with the main idea of the project.</li>
231</ul>
232
233<a name=authors><h2>Who are the authors of the ALGLIB?</h2></a>
234
235<p align=justify>
236The first version of ALGLIB was made by Vladimir Bystritsky. He spent a number of years on the maintenance of the website by himself. Eventually, he lost his interest in the website, so I (Sergey Bochkanov) took over the work on its maintenance, by common agreement.
237</p>
238
239<a name=rus><h2>What relation does the website have to Russia?</h2></a>
240
241<p align=justify>
242Originally, ALGLIB was a Russian-language website. Later on, a part of the website was translated into English. At present, there are two versions of the site - Russian and English.
243</p>
244
245<a name=algopascal><h2>What is AlgoPascal?</h2></a>
246
247<p align=justify>
248AlgoPascal is a programming language, designed particularly for this project. The programs, written in this language, are processed by a server-side automatic translator and translated into other programming languages by the computer. More detailed information is provided in section <a href="http://www.alglib.net/aboutsite.php">"About the site"</a>.
249</p>
250
251<a name=other><h2>Where can I find the algorithms for the work with files, drawing pictures in OpenGL, etc?</h2></a>
252
253<p align=justify>
254As we noted before, the main goal of ALGLIB is to create a multilingual library of algorithms in the area of numerical analysis. The problems, related to those enumerated in the question, do not fall into this category. Exceptions are made for a number of problems, though the project can be characterized by a clear-cut specialization.
255</p>
256
257</body>
258</html>
Note: See TracBrowser for help on using the repository browser.