]> Creatis software - CreaPhase.git/blob - octave_packages/fixed-0.7.10/doc.info
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / fixed-0.7.10 / doc.info
1 This is fixed.info, produced by makeinfo version 4.11 from fixed.texi.
2
3 \1f
4 File: fixed.info,  Node: Top,  Next: Basics
5
6 Fixed Point Toolbox for Octave
7 ******************************
8
9 * Menu:
10
11 * Basics:: The basics of the fixed point types
12 * Programming:: Using the fixed-point type in C++ and oct-files
13 * Example:: Fixed point type applied to real signal processing example
14 * Function Reference:: Documentation from the fixed point specific functions
15
16 \1f
17 File: fixed.info,  Node: Basics,  Next: Programming,  Prev: Top,  Up: Top
18
19 1 The Basics of the Fixed Point Types
20 *************************************
21
22 When implementing algorithms in hardware, it is common to reduce the
23 accuracy of the representation of numbers to a smaller number of bits.
24 This allows much lower complexity in the hardware, at the cost of
25 accuracy and potential overflow problems. Such representations are
26 known as fixed point.
27
28    This toolbox supplies a fixed point type that allows Octave to model
29 the effects of such a reduction in accuracy of the representation of
30 numbers.  The major advantage of this toolbox is that with correctly
31 written Octave scripts, the same code can be used to test both fixed
32 and floating point representations of numbers.
33
34    The authors have tried to take all care to ensure the correct
35 functionality of this package. However, as this code is relatively
36 recent we expect that there will be a certain number of problems. We
37 welcome all reports of bugs, etc or even success stories. The authors
38 can be contacted at the e-mail address <David.Bateman@motorola.com>.
39
40 * Menu:
41
42 * License:: The License used with this Package
43 * Representation:: Representation of fixed point numbers
44 * Creation:: Creation of fixed point numbers
45 * Overflow:: Overflow Behavior of Fixed Point Numbers
46 * Built-in Variables:: Fixed Point Built-in Variables
47 * Accessing Internal Fields:: The properties of fixed point numbers
48 * Function Overloading:: Fixed point numbers with existing Octave functions
49 * Together:: Putting it all together
50 * Precision:: Problems of precision in calculations
51 * Lookup Tables:: The use of Lookup tables with fixed point values;
52 * Known Problems:: Read this before reporting a bug
53
54 \1f
55 File: fixed.info,  Node: License,  Next: Representation,  Prev: Basics,  Up: Basics
56
57 1.1 The License used with this Package
58 ======================================
59
60 The license used with this package is the GNU General Public License, a
61 copy of which is distributed with this package in the file `COPYING'.
62 Some commercial users have seemed quite concerned about the use of
63 software licensed under the GPL in their development. To ease these
64 concerns, the authors state in clear English the terms of the GPL allow
65 that
66
67   1. Any algorithm developed with this package remains the sole property
68      of the party developing the algorithm.
69
70   2. Changes can be made to the fixed point package, with the
71      constraint that if you supply a version of the fixed point package
72      to another party it must equally be covered by the terms of the
73      GPL.
74
75    We believe that there is little reason to make proprietary changes to
76 the fixed point package itself. So this clear distinction between the
77 fixed point code itself and algorithms developed with it means that
78 there should be little concern for a use of this package in the
79 development of a proprietary algorithms.
80
81    Proprietary changes to the fixed point package itself are possible.
82 The GPL only comes into play in if you distribute the fixed point
83 package with these changes. The algorithms developed on these modified
84 versions of the fixed point package remain proprietary in all cases.
85
86 \1f
87 File: fixed.info,  Node: Representation,  Next: Creation,  Prev: License,  Up: Basics
88
89 1.2 Fixed Point Representation
90 ==============================
91
92 Fixed point numbers can be represented digitally in several manners,
93 including _sign-magnitude_, _ones-complement_ and _twos-complement_.
94 The most commonly used technique is _twos-complement_ due to the easier
95 implementation of certain operations in this representation. As such
96 this toolbox uses the _twos-complement_ representation of numbers
97
98    All fixed point objects in this toolbox are represented by an _int_
99 that is used in the following manner
100
101 1 bit representing the sign,
102
103 IS bits representing the integer part of the number, and
104
105 DS bits representing the decimal part of the number.
106
107    The numbers that can then be represented are then given by
108
109      - 2 ^ IS <= X <= 2 ^IS -1
110
111    and the distance between two values of X that are not represented by
112 the same fixed point value is 2 ^ (-DS) .
113
114    The number of bits that can be used in the representation of the
115 fixed point objects is determined by the number of bits in an _int_ on
116 the platform. Valid values include 32- and 64-bits. To avoid issues with
117 overflows in additions, one of these bits can not be used. Therefore
118 valid values of IS and DS are given by
119
120      0 < ( IS + DS ) < N - 2
121
122    where N is either 32 or 64, depending on the number of bits in an
123 _int_. It should be noted that given the above criteria it is possible
124 to create a fixed point representation that lacks a representation of
125 the number 1. This makes the implementation of certain operators
126 difficult, and so the valid representations are further limited to
127
128      0 < ( IS, DS, IS + DS ) < N - 2
129
130    This does not mean that other numbers can not be represented by this
131 toolbox, but rather that the numbers must be scaled prior to their
132 being represented.
133
134    This toolbox allows both fixed point real and complex scalars to be
135 represented, as well as fixed point real and complex matrices. The real
136 and imaginary parts of the fixed point number and each element of a
137 fixed point matrix has its own fixed point representation.
138
139 \1f
140 File: fixed.info,  Node: Creation,  Next: Overflow,  Prev: Representation,  Up: Basics
141
142 1.3 Creating Fixed Point Numbers
143 ================================
144
145 Before using a fixed point type, some variables must be created that
146 use this type. This is done with the function "fixed". The function
147 "fixed" can be used in several manners, depending on the number and
148 type of the arguments that are given. It can be used to create scalar,
149 complex, matrix and complex matrix values of the fixed type.
150
151    The generic call to "fixed" is `fixed(IS,DS,F)', where the variables
152 are
153
154 IS
155      The number of bits to use in the representation of the integer
156      part of the fixed point value. This can be either a real or
157      complex value, and can be either a scalar or a matrix. As the
158      fixed point representation of complex values uses separate
159      representations for the real and imaginary parts, a complex value
160      of IS gives the representation of the real and imaginary parts
161      separately. IS must contain only integer or complex integer values
162      greater than zero, and less than 30 or 62 as discussed in the
163      previous section.
164
165 DS
166      Similarly to IS, DS represents the number of bits in the decimal
167      part of the fixed point representation. The same conditions as for
168      IS apply to DS
169
170 F
171      This variable can be either a scalar, complex, matrix or complex
172      matrix of values that will be converted to a fixed point
173      representation. It can equally be another fixed point value, in
174      which case "fixed" has the effect of changing the representation
175      of F to another representation given by IS and DS.
176
177    If matrices are used for IS, DS, or F, then the dimensions of all of
178 the matrices must match. However, it is valid to have IS or DS as
179 scalar values, which will be expanded to the same dimension as the
180 other matrices, before use in the conversion to a fixed point value.
181 The variable F however, must be a matrix if either IS or DS is a matrix.
182
183    The most basic use of the function "fixed" can be seen in the example
184
185      octave:1> a = fixed(7,2,1)
186      ans = 1
187      octave:2> isfixed(a)
188      ans = 1
189      octave:3> whos a
190      *** local user variables:
191
192      prot  type                       rows   cols  name
193      ====  ====                       ====   ====  ====
194       rwd  fixed scalar                  1      1  a
195
196    which demonstrates the creation of a real scalar fixed point value
197 with 7 bits of precision in the integer part, 2 bits in the decimal
198 part and the value 1. The function "isfixed" can be used to identify
199 whether a variable is of the fixed point type or not. Equally, using
200 the "whos" function allows the variable to be identified as "fixed
201 scalar".
202
203    Other examples of valid uses of "fixed" are
204
205      octave:1> a = fixed(7, 2, 1);
206      octave:2> b = fixed(7, 2+1i, 1+1i);
207      octave:3> c = fixed(7, 2, 255*rand(10,10) - 128);
208      octave:4> is = 3*ones(10,10) + 4*eye(10);
209      octave:5> d = fixed(is, 1, eye(10));
210      octave:6> e = fixed(7, 2, 255*rand(10,10)-128 +
211      >                  1i*(255*rand(10,10)-128));
212      octave:7> whos
213
214      *** local user variables:
215
216      prot  type                       rows   cols  name
217      ====  ====                       ====   ====  ====
218       rwd  fixed scalar                  1      1  a
219       rwd  fixed complex                 1      1  b
220       rwd  fixed matrix                 10     10  c
221       rwd  fixed matrix                 10     10  d
222       rwd  fixed complex matrix         10     10  e
223
224    With two arguments given to "fixed", it is assumed that F is zero or
225 a matrix of zeros, and so "fixed" called with two arguments is
226 equivalent to calling with three arguments with the third arguments
227 being zero. For example
228
229      octave:1> a = fixed([7,7], [2,2], zeros(1,2));
230      octave:2> b = fixed([7,7], [2,2]);
231      octave:3> assert(a == b);
232
233    Called with a single argument "fixed", and a fixed point argument,
234 `b = fixed(A)' is equivalent to `b = a'. If A is not itself fixed
235 point, then the integer part of A is used to create a fixed point
236 value, with the minimum number of bits needed to represent it. For
237 example
238
239      octave:1> b = fixed(1:4);
240
241    creates a fixed point row vector with 4 values. Each of these values
242 has the minimum number of bits needed to represent it. That is b(1)
243 uses 1 bit to represent the integer part, b(2:3) use 2 bits and b(4)
244 uses 3 bits. The single argument used with "fixed" can equally be a
245 complex value, in which case the real and imaginary parts are treated
246 separately to create a composite fixed point value.
247
248 \1f
249 File: fixed.info,  Node: Overflow,  Next: Built-in Variables,  Prev: Creation,  Up: Basics
250
251 1.4 Overflow Behavior of Fixed Point Numbers
252 ============================================
253
254 When converting a floating point number to a fixed point number the
255 overflow behavior of the fixed point type is such that it implements
256 clipping of the data to the maximum or minimum value that is
257 representable in the fixed point type. This effectively simulates the
258 behavior of an analog to digital conversion. For example
259
260      octave:1> a = fixed(7,2,200)
261      a = 127.75
262      octave:2> a = fixed(7,2,-200)
263      a = -128
264
265    However, the overflow behavior of the fixed point type is distinctly
266 different if the overflow occurs within a fixed point operation itself.
267 In this case the excess bits generated by the overflow are dropped.
268 For example
269
270      octave:1> a = fixed(7,2,127) + fixed(7,2,2)
271      a = -127
272      octave:2> a = fixed(7,2,-127) + fixed(7,2,-2)
273      a = 127
274
275    The case where the representation of the fixed point object changes
276 is different again. In this case the sign is maintained, while the
277 most-significant bits of the representation are dropped. For example
278
279      octave:1> a = fixed(6, 2, fixed(7, 2, -127.25))
280      a = -63.25
281      octave:2> a = fixed(6, 2, fixed(7, 2, 127.25))
282      a = 63.25
283      octave:3> a = fixed(7, 1, fixed(7, 2, -127.25))
284      a = -127.5
285      octave:4> a = fixed(7, 1, fixed(7, 2, 127.25))
286      a = 127
287
288    In addition to the overflow issue discussed above, it is important to
289 take into account what happens when an operator is used on two fixed
290 point values with different representations. For example
291
292      octave:1> a = fixed(7,2,1);
293      octave:2> b = fixed(6,3,1);
294      octave:3> c = a + b;
295      octave:4> fprintf("%d integer, and %d decimal bits\n", c.int, c.dec);
296      7 integer, and 3 decimal bits
297
298    as can be seen the fixed point value is promoted to have an output
299 fixed point representation such that `c.int = max(a.int,b.int)' and
300 `c.dec = max(a.dec,b.dec)'. If this promotion causes the maximum number
301 of bits in a fixed point representation to be exceeded, then an error
302 will occur.
303
304 \1f
305 File: fixed.info,  Node: Built-in Variables,  Next: Accessing Internal Fields,  Prev: Overflow,  Up: Basics
306
307 1.5 Fixed Point Built-in Variables
308 ==================================
309
310 After the fixed point type is first used, four variables are
311 initialized.  These are
312
313 fixed_point_version
314      The version number of the fixed point code
315
316 fixed_point_warn_overflow
317      If non-zero warn of fixed point overflows. The default is 0.
318
319 fixed_point_count_operations
320      If non-zero count number of fixed point operations, for later
321      complexity analysis
322
323 fixed_point_debug
324      If non-zero keep a copy of fixed point value to allow easier
325      debugging with gdb
326
327    and they can be accessed as normal Octave built-in variables. The
328 variable `fixed_point_version' can be used to create tests in the users
329 code, to work-around any eventual problems in the fixed point type. For
330 example
331
332      if (strcmp(fixed_point_version, "0.6.0"))
333        a = fixed([a.int, b.int], [a.dec, b.dec],
334                 [a.x, b.x]);
335      else
336        a = concat(a, b);
337      endif
338
339    although this is not a real example, since both versions of the
340 above code work with the released version of the fixed point type.
341
342    When optimizing the number of bits in a fixed point type, it is
343 normal to expect overflows to occur, causing errors in the calculations
344 which due to the implementation have little effect on the end result of
345 the system.  However, it is sometimes useful to know exactly where
346 overflows are happening or not. A non-zero value of variable
347 `fixed_point_warn_overflow' permits the errors conditions in fixed
348 point operations to cause a warning message to be printed by octave.
349 The default behavior is to have `fixed_point_warn_overflow' be 0.
350
351    The octave fixed point type can keep track of all of the fixed point
352 operations and their type. This is very useful for a simple complexity
353 analysis of the algorithms. To allow the fixed point type to track
354 operations the variable `fixed_point_count_operations' must be
355 non-zero. The count of operations can then be reset with the
356 "reset_fixed_operations", and the number of operations since the last
357 reset can be given by the  "display_fixed_operations" function.
358
359    The final in-built variable of the fixed point type is
360 `fixed_point_debug'.  In normal operation this variable is of no use.
361 However setting it to a non-zero value causes a copy of the floating
362 point representation of a fixed point value to be stored internally.
363 This makes debugging code using the fixed point type significantly
364 easier using gdb.
365
366 \1f
367 File: fixed.info,  Node: Accessing Internal Fields,  Next: Function Overloading,  Prev: Built-in Variables,  Up: Basics
368
369 1.6 Accessing Internal Fields
370 =============================
371
372 Once a variable has been defined as a fixed point object, the
373 parameters of the field of this structure can be obtained by adding a
374 suffix to the variable.  Valid suffixes are '.x', '.i', '.sign', '.int'
375 and '.dec', which return
376
377 .x
378      The floating point representation of the fixed point number
379
380 .i
381      The internal integer representation of the fixed point number
382
383 .sign
384      The sign of the fixed point number
385
386 .int
387      The number of bits representing the integer part of the fixed
388      point number
389
390 .dec
391      The number of bits representing the decimal part of the fixed
392      point number
393
394    As each fixed point value in a matrix can have a different number of
395 bits in its representation, these suffixes return objects of the same
396 size as the original fixed point object. For example
397
398      octave:1> a = [-3:3];
399      octave:2> b = fixed(7,2,a);
400      octave:3> b.sign
401      ans =
402
403        -1  -1  -1   0   1   1   1
404      octave:4> b.int
405      ans =
406
407        7  7  7  7  7  7  7
408      octave:5> b.dec
409      ans =
410
411        2  2  2  2  2  2  2
412      octave:5> c = b.x;
413      octave:6> whos
414
415      *** local user variables:
416
417      prot  type                       rows   cols  name
418      ====  ====                       ====   ====  ====
419       rwd  matrix                        1      7  a
420       rwd  fixed matrix                  1      7  b
421       rwd  matrix                        1      7  c
422
423    The suffixes '.int' and '.dec' can also be used to change the
424 internal representation of a fixed point value. This can result in a
425 loss of precision in the representation of the fixed point value, which
426 models the same process as occurs in hardware. For example
427
428      octave:1> b = fixed(7,2,[3.25, 3.25]);
429      octave:2> b(1).dec = [0, 2];
430      b =
431
432           3  3.25
433
434    However, the value itself should not be changed using the suffix
435 '.x'.  For instance
436
437      octave:3> b.x = [3, 3];
438      error: can not directly change the value of a fixed structure
439      error: assignment failed, or no method for `fixed matrix = matrix'
440      error: evaluating assignment expression near line 3, column 6
441
442 \1f
443 File: fixed.info,  Node: Function Overloading,  Next: Together,  Prev: Accessing Internal Fields,  Up: Basics
444
445 1.7 Function Overloading
446 ========================
447
448 An important consideration in the use of the fixed point toolbox is
449 that many of the internal functions of Octave, such as "diag", can not
450 accept fixed point objects as an input. This package therefore uses the
451 "dispatch" function of Octave-Forge to _overload_ the internal Octave
452 functions with equivalent functions that work with fixed point objects,
453 so that the standard function names can be used. However, at any time
454 the fixed point specific version  of the function can be used by
455 explicitly calling its function name. The correspondence between the
456 internal function names and the fixed point versions is as follows
457
458 `abs'    -   `fabs',      `atan2'   -   `fatan2',    `ceil'    -   `fceil',
459 `conj'   -   `fconj',     `cos'     -   `fcos',      `cosh'    -   `fcosh',
460 `cumprod'-   `fcumprod',  `cumsum'  -   `fcumsum',   `diag'    -   `fdiag',
461 `exp'    -   `fexp',      `floor'   -   `ffloor',    `imag'    -   `fimag',
462 `log10'  -   `flog10',    `log'     -   `flog',      `prod'    -   `fprod',
463 `real'   -   `freal',     `reshape' -   `freshape',  `round'   -   `fround',
464 `sin'    -   `fsin',      `sinh'    -   `fsinh',     `sort'    -   `fsort',
465 `sqrt'   -   `fsqrt',     `sum'     -   `fsum',      `sumsq'   -   `fsumsq',
466 `tan'    -   `ftan',      `tanh'    -   `ftanh'.                   
467
468    The version of the function that is chosen is determined by the first
469 argument of the function. So, considering the "atan2" function, if the
470 first argument is a _Matrix_, then the normal version of the function
471 is called regardless of whether the other argument of the function is a
472 fixed point objects or not.
473
474    Many other Octave functions work correctly with fixed point objects
475 and so overloaded versions are not necessary. This includes such
476 functions as "size" and "any".
477
478    It is also useful to use the '.x' option discussed in the previous
479 section, to extract a floating point representation of the fixed point
480 object for use with some functions.
481
482 \1f
483 File: fixed.info,  Node: Together,  Next: Precision,  Prev: Function Overloading,  Up: Basics
484
485 1.8 Putting it all Together
486 ===========================
487
488 Now that the basic functioning of the fixed point type has been
489 discussed, it is time to consider how to put all of it together.  The
490 list of functions available for the fixed point type can be found in a
491 later section of this document (*note Function Reference::)
492
493    The main advantage of this fixed point type over an implementation of
494 specific fixed point code, is the ability to define a function once and
495 use as either fixed or floating point. Consider the example
496
497      function [b, bf] = testfixed(is,ds,n)
498      a = randn(n,n);
499      af = fixed(is,ds,a);
500      b = myfunc(a,a);
501      bf = myfunc(af,af);
502      endfunction
503
504      function y = myfunc(a,b)
505      y = a + b;
506      endfunction
507
508    In this case `b' and `bf' will be returned from the function
509 "testfixed" as floating and fixed point types respectively, while the
510 underlying function "myfunc" does not explicitly define that it uses a
511 fixed point type. This is a major advantage, as it is critical to
512 understand the loss of precision in an algorithm when converting from
513 floating to fixed point types for an optimal hardware implementation.
514 This mixing of functions that treat both floating and fixed point types
515 can even apply to Oct-files (*note Oct-files::).
516
517    The main limitation to the above is the use of the concatenation
518 operator, such as `[a,b]', that is hard-coded in versions of Octave
519 prior to 2.1.58 and is thus not aware of the fixed-point type.
520 Therefore, such code should be avoided in earlier versions of Octave
521 and the function "concat" supplied with this package used instead.
522
523 \1f
524 File: fixed.info,  Node: Precision,  Next: Lookup Tables,  Prev: Together,  Up: Basics
525
526 1.9 Problems of Precision in Calculations
527 =========================================
528
529 When dimensioning the fixed point variables, care must be taken so that
530 all intermediate operations don't cause a loss in the precision. This
531 can occur with any operator or function that takes a large argument and
532 gives a small result. Minor variations in the initial argument can
533 result in large changes in the final result.
534
535    For instance, consider the "log" operator, in the example
536
537      octave:1> a = fixed(7,2,5.25);
538      octave:2> b = exp(log(a))
539      b = 4.25
540
541    The logarithm `log(a)' is 1.65, which is rounded to 1.5. The
542 exponential `exp(log(a))' is then 4.48 which is rounded to 4.25.
543
544    A particular case in point is the power operator for complex number,
545 which is implemented by the standard C++ class as
546
547      X ^ Y = exp ( Y * log(X) )
548
549    Unless a large decimal precision is specified for this operator, the
550 results will be wildly different than expected. For example
551
552      octave:1> fixed(7,2,4*1i) ^ fixed(7,2,1)
553      ans = 0.000 + 2.250i
554      octave:2> fixed(7,5,4*1i) ^ fixed(7,5,1)
555      ans = 0.000000 + 3.812500i
556
557    If the user chooses to use certain functions and operators, it is
558 their responsibility to understand the implementation of the these
559 operators, as used by their compilers to ensure the desired behavior.
560 Alternatively, the user is recommended to implement certain operations
561 as lookup tables, rather than use the built-in operator or function.
562 This is how such general functions are implemented in hardware and so
563 this is not a significant problem.
564
565 \1f
566 File: fixed.info,  Node: Lookup Tables,  Next: Known Problems,  Prev: Precision,  Up: Basics
567
568 1.10 Lookup Tables
569 ==================
570
571 It is common to implement complex functions in hardware by an equivalent
572 lookup table. This has the advantage of speed, saving on the complexity
573 of a full implementation of certain functions, and avoiding rounding
574 errors if the complex function is implemented as a combination of
575 sub-functions. The disadvantage is that the lookup requires the use of
576 a read-only memory in hardware. Due to size limitations on this memory
577 it might not be possible to represent all possible values of a function.
578
579    This section discusses the use of lookup tables with the fixed point
580 type.  It is assumed that the function "lookup" of Octave-forge is
581 installed.  The easiest way to explain the use of a fixed point lookup
582 table is to discuss an example. Consider a fixed point value in the
583 range `-pi:pi', and we wish to represent the sine function in this
584 range.  The creation of the lookup table can then be performed as
585 follows.
586
587      octave:1> is = 2; ds = 6;
588      octave:2> x = [-3.125:0.125:3.125];  % 3.125 ~ pi
589      octave:3> y = sin(x);
590      octave:4> table_float = create_lookup_table(x, y);
591      octave:5> table_fixed = create_lookup_table(fixed(is,ds,x),
592      >                          fixed(is,ds,y));
593
594    A real implementation of this function in hardware might use to the
595 symmetry of the sine function to only require the lookup table for
596 `[0:pi/2]' to be stored. However, for simulation there is little reason
597 to introduce this complication.
598
599    To evaluate the value of the function use the lookup table created by
600 "create_lookup_table", the function "lookup_table" is then used. This
601 function can either be used to give the closest evalued value below the
602 desired value, or it can be used to interpolate the table as might be
603 done in hardware. For example
604
605      octave:6> x0 = [-pi:0.01:pi];
606      octave:7> y0 = sin(x);
607      octave:8> y1 = lookup_table(table_float, x0, "linear");
608      octave:9> y2 = lookup_table(table_fixed, fixed(is,ds,x0), "linear");
609
610 \1f
611 File: fixed.info,  Node: Known Problems,  Prev: Lookup Tables,  Up: Basics
612
613 1.11 Known Problems
614 ===================
615
616 Before reporting a bug compare it to this list of known problems
617
618 Concatenation
619      For versions of Octave prior to 2.1.58, the concatenation of fixed
620      point objects returns a Matrix type. That is `[fixed(7,2,[1, 2]),
621      fixed(7,2,3)]' returns a matrix when it should return another
622      fixed point matrix. This problem is due to the implementation of
623      matrix concatenation in earlier versions of Octave being
624      hard-coded for the basic types it knows rather than being
625      expandable.
626
627      The workaround is to explicitly convert the returned value back to
628      the correct fixed point object. For instance
629
630           octave:1> a = fixed(7,2,[1,2]);
631           octave:2> b = fixed(7,2,3);
632           octave:3> c = fixed([a.int, b.int], [a.dec, b.dec],
633           >           [a.x, b.x]);
634
635      Alternatively, use the supplied function "concat" that explicitly
636      performs the above above, but can also be used for normal matrices.
637
638      Since Octave version 2.1.58, `[fixed(7,2,[1,2]),fixed(7,2,3)]'
639      returns another fixed point object as expected.
640
641 Saving fixed point objects
642      Saving of fixed point variables is only implemented in versions of
643      Octave later than 2.1.53. If you are using a recent version of
644      Octave then saving a fixed point variable is as simple as
645
646           octave:2> save a.mat a
647
648      where A is a fixed point variable. To reload the variable within
649      octave, the fixed point types must be installed prior to a call to
650      "load". That is
651
652           octave:1> dummy = fixed(1,1);
653           octave:2> load a.mat
654
655      With versions of octave later than 2.1.53, fixed point variables
656      can be saved in the octave binary and ascii formats, as well as
657      the HDF5 format. If you are using an earlier version of octave,
658      you can not directly save a fixed point variable. You can however
659      save the information it contains and reconstruct the data
660      afterwards by doing something like
661
662           octave:2> x = a.x; is = a.int; ds = a.dec;
663           octave:3> save a.mat x is ds;
664
665      where A is a fixed point object.
666
667 Some functions and operators return very poor results
668      Please read the previous section. Also if the problem manifests
669      when using complex arguments, try to understand your compilers
670      constructor of complex operators and functions from the base fixed
671      point operators and functions.  The relevant file for the gcc 3.x
672      versions of the compiler can be found in
673      `/usr/include/g++-v3/bits/std_complex.h'.
674
675 Function "foo" returns fixed point types while "bar"
676      does not?  If the existing functions, written as m-files, respect
677      the use (or rather non-use) of the concatentaion operator, then
678      these functions will operate correctly. However, many functions
679      don't and thus will return a floating type for a fixed point
680      input, when run on versions of Octave earlier than 2.1.58. All
681      functions should be checked by the user for their correct
682      operation before using them.
683
684      Additionally, existing oct-files will not operate correctly with
685      fixed point inputs, as they are not aware of the fixed point type
686      and will just extract the floating point value to operate on.
687
688      A third class of function are the inbuilt functions like "any",
689      "size", etc. As the fixed point type includes the underlying
690      functions for these to work correctly, they give the correct
691      result even though there is no corresponding fixed point specific
692      version of these functions.
693
694 Why is my code so slow when using fixed point
695      This is due to several reasons, firstly the normal functions in
696      octave use optimized libraries to accelerate their operation. This
697      is not possible when using fixed point.
698
699      Also there is no fixed point type native to the machines Octave
700      runs on. This naturally makes the fixed point type slow, due to
701      the fact that the fixed point operators check for overflows, etc
702      at all steps in the operation and act accordingly. This is
703      particularly true in the case of matrix multiplication where each
704      multiplication and addition can be subject to overflows. Thus
705
706           octave:1> x = randn(100,100);
707           octave:2> y0 = fixed(7,6,x*x);
708           octave:3> y1 = fixed(7,6,x)*fixed(7,6,x);
709
710      does not give equivalent operations for Y0 and Y1. With all this
711      additionally checking, you can not expect your code to run as fast
712      when using the fixed point type.
713
714 When running under cygwin I get a dlopen error.
715      The build under cygwin is slightly different, in that most of the
716      fixed point functions are compiled as a shared library that is
717      linked to the main oct-file.  This is to allow other oct-files to
718      use the fixed-point type which is not possible under cygwin
719      otherwise, since compilation under cygwin requires that all
720      symbols are resolved at compile time.
721
722      If the shared libraries are not installed somewhere that can be
723      found when running octave, then you will get an error like
724
725           octave:1> a = fixed(7,2,1)
726           error: dlopen: Win32 error 126
727           error: `fixed' undefined near line 1 column 5
728           error: evaluating assignment expression near line 1, column 3
729
730    There are two files `liboctave_fixed.dll' and `liboctave_fixed.dll.a'
731 that must be installed. Typically, these should be installed in the same
732 directory that you can `liboctave.dll' and `liboctave.dll.a'
733 respectively. If you use the same `--prefix' option to configure both
734 octave and octave-forge then this should happen automatically.
735
736 \1f
737 File: fixed.info,  Node: Programming,  Next: Example,  Prev: Basics,  Up: Top
738
739 2 Using the fixed-point type in C++ and oct-files
740 *************************************************
741
742 Octave supplies a matrix template library to create matrix and vector
743 objects from basic types. All of the properties of these Octave classes
744 will not be described here. However the base classes and the
745 particularly of the classes created using the Octave matrix templates
746 will be discussed.
747
748    There are two basic fixed point types: `FixedPoint' and
749 `FixedPointComplex' representing the fixed point representation of real
750 and complex numbers respectively. The Octave matrix templates are used
751 to created the classes `FixedMatrix', `FixedRowVector' and
752 `FixedColumnVector' from the base class `FixedPoint'. Similar the
753 complex fixed point types `FixedComplexMatrix', `FixedComplexRowVector'
754 and `FixedComplexColumnVectors' are constructed from the base class
755 `FixedPointComplex'
756
757    This section discusses the definitions of the base classes, their
758 extension with the Octave matrix templates, the upper level Octave
759 classes and the use of all of these when writing oct-files.
760
761 * Menu:
762
763 * FixedPoint:: The `FixedPoint' base class
764 * FixedPointComplex:: The `FixedPointComplex' base class
765 * Derived:: The derived classes using the Octave template classes
766 * Upper:: The upper level Octave classes
767 * Oct-files:: Writing oct-files with the fixed point type
768
769 \1f
770 File: fixed.info,  Node: FixedPoint,  Next: FixedPointComplex,  Prev: Programming,  Up: Programming
771
772 2.1 The `FixedPoint' Base Class
773 ===============================
774
775 * Menu:
776
777 * FPConstructors:: `FixedPoint' constructors
778 * FPSpecific:: `FixedPoint' specific methods
779 * FPOperators:: `FixedPoint' operators
780 * FPFunctions:: `FixedPoint' functions
781
782 \1f
783 File: fixed.info,  Node: FPConstructors,  Next: FPSpecific,  Prev: FixedPoint,  Up: FixedPoint
784
785 2.1.1 `FixedPoint' Constructors
786 -------------------------------
787
788 `FixedPoint::FixedPoint ()'
789      Create a fixed point object with only a sign bit
790
791 `FixedPoint::FixedPoint (unsigned int is, unsigned int ds)'
792      Create a fixed point object with `is' bits for the integer part and
793      `ds' bits for the decimal part. The fixed point object will be
794      initialized to be zero
795
796 `FixedPoint::FixedPoint (unsigned int is, unsigned int ds, FixedPoint &x)'
797      Create a fixed point object with `is' bits for the integer part and
798      `ds' bits for the decimal part, loaded with the fixed point value
799      `x'. If `is + ds' is greater than `sizeof(int)*8 - 2', the error
800      handler is called.
801
802 `FixedPoint::FixedPoint (unsigned int is, unsigned int ds, const double x)'
803      Create a fixed point object with `is' bits for the integer part and
804      `ds' bits for the decimal part, loaded with the value `x'. If `is
805      + ds' is greater than `sizeof(int)*8 - 2', the error handler is
806      called.
807
808 `FixedPoint::FixedPoint (unsigned int is, unsigned int ds, unsigned int i, unsigned int d)'
809      Create a fixed point object with `is' bits for the integer part and
810      `ds' bits for the decimal part, loading the integer part with `i'
811      and the decimal part with `d'. It should be noted that `i' and `d'
812      are both unsigned and are the strict representation of the bits of
813      the fixed point value.
814
815 `FixedPoint::FixedPoint (const int x)'
816      Create a fixed point object with the minimum number of bits for
817      the integer part `is' needed to represent `x'. If `is' is greater
818      than `sizeof(int)*8 - 2', the error handler is called.
819
820 `FixedPoint::FixedPoint (const double x)'
821      Create a fixed point object with the minimum number of bits for
822      the integer part `is' needed to represent the integer part of `x'.
823      If `is' is greater than `sizeof(int)*8 - 2', the error handler is
824      called.
825
826 `FixedPoint::FixedPoint (const FixedPoint &x)'
827      Create a copy of the fixed point object `x'
828
829 \1f
830 File: fixed.info,  Node: FPSpecific,  Next: FPOperators,  Prev: FPConstructors,  Up: FixedPoint
831
832 2.1.2 `FixedPoint' Specific Methods
833 -----------------------------------
834
835 `double FixedPoint::fixedpoint()'
836      Method to create a `double' from the current fixed point object
837
838 `double fixedpoint (const FixedPoint &x)'
839      Create a `double' from the fixed point object `x'
840
841 `int FixedPoint::sign ()'
842      Return `-1' for negative numbers, `1' for positive and `0' if the
843      current fixed point object is zero.
844
845 `int sign (FixedPoint &x)'
846      Return `-1' for negative numbers, `1' for positive and `0' if the
847      fixed point object `x' is zero.
848
849 `char FixedPoint::signbit ()'
850      Return the sign bit of the current fixed point number (`0' for
851      positive number, `1' for negative number).
852
853 `char signbit (FixedPoint &x)'
854      Return the sign bit of the fixed point number `x' (`0' for positive
855      number, `1' for negative number).
856
857 `int FixedPoint::getintsize ()'
858      Return the number of bit `is' used to represent the integer part
859      of the current fixed point object.
860
861 `int getintsize (FixedPoint &x)'
862      Return the number of bit `is' used to represent the integer part
863      of the fixed point object `x'.
864
865 `int FixedPoint::getdecsize ()'
866      Return the number of bit `ds' used to represent the decimal part
867      of the current fixed point object.
868
869 `int getdecsize (FixedPoint &x)'
870      Return the number of bit `ds' used to represent the decimal part
871      of the fixed point object `x'.
872
873 `unsigned int FixedPoint::getnumber ()'
874      Return the integer representation of the fixed point value of the
875      current fixed point object.
876
877 `unsigned int getnumber (FixedPoint &x)'
878      Return the integer representation of the fixed point value of the
879      fixed point object `x'.
880
881 `FixedPoint FixedPoint::chintsize (const int n)'
882      Return a fixed point object equivalent to the current fixed point
883      number but with the number of bits representing the integer part
884      `is' changed to `n'. If the result of this operation causes `is +
885      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
886      called.
887
888 `FixedPoint FixedPoint::chdecsize (const int n)'
889      Return a fixed point object equivalent to the current fixed point
890      number but with the number of bits representing the decimal part
891      `ds' changed to `n'. If the result of this operation causes `is +
892      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
893      called.
894
895 `FixedPoint FixedPoint::incintsize (const int n)'
896      Return a fixed point object equivalent to the current fixed point
897      number but with the number of bits representing the integer part
898      `is' increased by `n'. If `n' is negative, then `is' is decreased.
899      If the result of this operation causes `is + ds' to be greater than
900      `sizeof(int)*8 - 2', the error handler is called.
901
902 `FixedPoint FixedPoint::incintsize ()'
903      Return a fixed point object equivalent to the current fixed point
904      number but with the number of bits representing the integer part
905      `is' increased by 1. If the result of this operation causes `is +
906      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
907      called.
908
909 `FixedPoint FixedPoint::incdecsize (const int n)'
910      Return a fixed point object equivalent to the current fixed point
911      number but with the number of bits representing the decimal part
912      `ds' increased by `n'. If `n' is negative, then `ds' is decreased.
913      If the result of this operation causes `is + ds' to be greater than
914      `sizeof(int)*8 - 2', the error handler is called.
915
916 `FixedPoint FixedPoint::incdecsize ()'
917      Return a fixed point object equivalent to the current fixed point
918      number but with the number of bits representing the decimal part
919      `ds' increased by 1. If the result of this operation causes `is +
920      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
921      called.
922
923 \1f
924 File: fixed.info,  Node: FPOperators,  Next: FPFunctions,  Prev: FPSpecific,  Up: FixedPoint
925
926 2.1.3 `FixedPoint' Operators
927 ----------------------------
928
929 `FixedPoint operator +'
930      Unary `+' of a fixed point object
931
932 `FixedPoint operator -'
933      Unary `-' of a fixed point object
934
935 `FixedPoint operator !'
936      Unary `!' operator of the fixedpoint object, with the the sign bit.
937      This is not the same operator as `-' and is not the same operator
938      as the octave `!' operator.
939
940 `FixedPoint operator ++'
941      Unary increment operator (pre and postfix). Uses the smallest
942      representable value to increment (ie `2 ^ (- ds)' )
943
944 `FixedPoint operator --'
945      Unary decrement operator (pre and postfix). Uses the smallest
946      representable value to decrement (ie `2 ^ (- ds)' )
947
948 `FixedPoint operator = (const FixedPoint &x)'
949      Assignment operators. Copies fixed point object `x'
950
951 `FixedPoint operator += (const FixedPoint &x)'
952 `FixedPoint operator -= (const FixedPoint &x)'
953 `FixedPoint operator *= (const FixedPoint &x)'
954 `FixedPoint operator /= (const FixedPoint &x)'
955      Assignment operators, working on both the input and output
956      objects. The output object's fixed point representation is
957      promoted such that the largest values of `is' and `ds' are taken
958      from the input and output objects. If the result of this operation
959      causes `is + ds' to be greater than `sizeof(int)*8 - 2', the error
960      handler is called.
961
962 `FixedPoint operator <<= (const int s)'
963 `FixedPoint operator << (const FixedPoint &x, const int s)'
964      Perform a left-shift of a fixed point object. This is equivalent
965      to a multiplication by a power of 2. The sign-bit is preserved.
966      This differs from the `rshift' function discussed below in the
967      `is' and `ds' are unchanged.
968
969 `FixedPoint operator >>= (const int s)'
970 `FixedPoint operator >> (const FixedPoint &x, const int s)'
971      Perform a right-shift of the fixed point object. This is
972      equivalent to a division by a power of 2. Note that the sign-bit
973      is preserved. This differs from the `rshift' function discussed
974      below in the `is' and `ds' are unchanged.
975
976 `FixedPoint operator + (const FixedPoint &x, const FixedPoint &y)'
977 `FixedPoint operator - (const FixedPoint &x, const FixedPoint &y)'
978 `FixedPoint operator * (const FixedPoint &x, const FixedPoint &y)'
979 `FixedPoint operator / (const FixedPoint &x, const FixedPoint &y)'
980      Two argument operators. The output objects fixed point
981      representation is promoted such that the largest values of `is'
982      and `ds' are taken from the two arguments. If the result of this
983      operation causes `is + ds' to be greater than  `sizeof(int)*8 -
984      2', the error handler is called.
985
986 `bool operator == (const FixedPoint &x, const FixedPoint &y)'
987 `bool operator != (const FixedPoint &x, const FixedPoint &y)'
988 `bool operator < (const FixedPoint &x, const FixedPoint &y)'
989 `bool operator <= (const FixedPoint &x, const FixedPoint &y)'
990 `bool operator > (const FixedPoint &x, const FixedPoint &y)'
991 `bool operator >= (const FixedPoint &x, const FixedPoint &y)'
992      Fixed point comparison operators. The fixed point object `x' and
993      `y' can have different representations (values of `is' and `ds').
994
995 `std::istream &operator >> (std::istream &s, FixedPoint &x)'
996      Read a fixed point object from `s' stream and store it into `x'
997      keeping the fixed point representation in `x'. If the value read is
998      not a fixed  point object, the error handler is invoked.
999
1000 `std::ostream &operator << (std::ostream &s, const FixedPoint &x)'
1001      Send into the stream `s', a formatted fixed point value `x'
1002
1003 \1f
1004 File: fixed.info,  Node: FPFunctions,  Prev: FPOperators,  Up: FixedPoint
1005
1006 2.1.4 `FixedPoint' Functions
1007 ----------------------------
1008
1009 `FixedPoint rshift (const FixedPoint &x, int s)'
1010      Do a right shift of `s' bits of a fixed precision number
1011      (equivalent to a division by a power of 2). The representation of
1012      the fixed point object is adjusted to suit the new fixed point
1013      object (i.e. `ds++' and `is = is == 0 ? 0 : is-1')
1014
1015 `FixedPoint lshift (const FixedPoint &x, int s)'
1016      Do a left shift of `s' bits of a fixed precision number (equivalent
1017      to a multiplication by a power of 2). The representation of the
1018      fixed point object is adjusted to suit the new fixed point object
1019      (i.e. `is++' and `ds = ds == 0 ? 0 : ds-1')
1020
1021 `FixedPoint abs (const FixedPoint &x)'
1022      Returns the modulus of `x'
1023
1024 `FixedPoint cos (const FixedPoint &x)'
1025      Returns the cosine of `x'
1026
1027 `FixedPoint cosh (const FixedPoint &x)'
1028      Returns the hyperbolic cosine of `x'
1029
1030 `FixedPoint sin (const FixedPoint &x)'
1031      Returns the sine of `x'
1032
1033 `FixedPoint sinh (const FixedPoint &x)'
1034      Returns the hyperbolic sine of `x'
1035
1036 `FixedPoint tan (const FixedPoint &x)'
1037      Returns the tangent of `x'
1038
1039 `FixedPoint tanh (const FixedPoint &x)'
1040      Returns the hyperbolic tangent of `x'
1041
1042 `FixedPoint sqrt (const FixedPoint &x)'
1043      Returns the square root of `x'
1044
1045 `FixedPoint pow (const FixedPoint &x, int y)'
1046 `FixedPoint pow (const FixedPoint &x, double y)'
1047 `FixedPoint pow (const FixedPoint &x, const FixedPoint &y)'
1048      Returns the `x' raised to the power `y'
1049
1050 `FixedPoint exp (const FixedPoint &x)'
1051      Returns the exponential of `x'
1052
1053 `FixedPoint log (const FixedPoint &x)'
1054      Returns the logarithm of `x'
1055
1056 `FixedPoint log10 (const FixedPoint &x)'
1057      Returns the base 10 logarithm of `x'
1058
1059 `FixedPoint atan2 (const FixedPoint &y, const FixedPoint &x)'
1060      Returns the arc tangent of `x' and `y'
1061
1062 `FixedPoint floor (const FixedPoint &x)'
1063      Returns the rounded value of `x' downwards to the nearest integer
1064
1065 `FixedPoint ceil (const FixedPoint &x)'
1066      Returns the rounded value of `x' upwards to the nearest integer
1067
1068 `FixedPoint rint (const FixedPoint &x)'
1069      Returns the rounded value of `x' to the nearest integer
1070
1071 `FixedPoint round (const FixedPoint &x)'
1072      Returns the rounded value of `x' to the nearest integer. The
1073      difference with `rint' is that `0.5' is rounded to `1' and not `0'.
1074      This conforms to the behavior of the octave `round' function.
1075
1076 `std::string getbitstring (const FixedPoint &x)'
1077      Return a string containing the bits of `x'
1078
1079 \1f
1080 File: fixed.info,  Node: FixedPointComplex,  Next: Derived,  Prev: FixedPoint,  Up: Programming
1081
1082 2.2 The `FixedPointComplex' Base Class
1083 ======================================
1084
1085 The `FixedPointComplex' class is derived using the C++ compilers
1086 inbuilt `complex' class and is instantiated as
1087 `std::complex<FixedPoint>'. Therefore the exact behavior of the complex
1088 fixed point type is determined by the complex class used by the C++
1089 compiler. The user is advised to understand their C++ compilers
1090 implementation of the complex functions that they use, and particularly
1091 the effects that they will have on the precision of fixed point
1092 operations.
1093
1094 * Menu:
1095
1096 * FPCConstructors:: `FixedPointComplex' constructors
1097 * FPCSpecific:: `FixedPointComplex' specific methods
1098 * FPCOperators:: `FixedPointComplex' operators
1099 * FPCFunctions:: `FixedPointComplex' functions
1100
1101 \1f
1102 File: fixed.info,  Node: FPCConstructors,  Next: FPCSpecific,  Prev: FixedPointComplex,  Up: FixedPointComplex
1103
1104 2.2.1 `FixedPointComplex' Constructors
1105 --------------------------------------
1106
1107 `FixedPointComplex::FixedPointComplex ()'
1108      Create a complex fixed point object with only a sign bit
1109
1110 `FixedPointComplex::FixedPointComplex (unsigned int is, unsigned int ds)'
1111      Create a complex fixed point object with `is' bits for the integer
1112      part and `ds' bits for the decimal part. The fixed point object
1113      will be initialized to zero.
1114
1115 `FixedPointComplex::FixedPointComplex (unsigned int is, unsigned int ds, FixedPoint &x)'
1116      Create a complex fixed point object with `is' bits for the integer
1117      part and `ds' bits for the decimal part of both real and imaginary
1118      parts, loaded with the fixed point value `x' in the real part and
1119      zero in the imaginary. If `is + ds' is greater than `sizeof(int)*8
1120      - 2', the error handler is called.
1121
1122 `FixedPointComplex::FixedPointComplex (unsigned int is, unsigned int ds, FixedPoint &r, FixedPoint &i)'
1123      Create a complex fixed point object with `is' bits for the integer
1124      part and `ds' bits for the decimal part of both real and imaginary
1125      parts, loaded with the fixed point value `r' in the real part and
1126      `i' the imaginary part. If `is + ds' is greater than
1127      `sizeof(int)*8 - 2', the error handler is called.
1128
1129 `FixedPointComplex::FixedPointComplex (unsigned int is, unsigned int ds, FixedPointComplex &x)'
1130      Create a complex fixed point object with `is' bits for the integer
1131      part and `ds' bits for the decimal part of both real and imaginary
1132      parts, loaded with the complex fixed point value `x'. If `is + ds'
1133      is greater than `sizeof(int)*8 - 2', the error handler is called.
1134
1135 `FixedPointComplex::FixedPointComplex (unsigned int is, unsigned int ds, const double x)'
1136      Create a complex fixed point object with `is' bits for the integer
1137      part and `ds' bits for the decimal part of both real and imaginary
1138      parts, loaded with the fixed point value `x' in the real part and
1139      zero in the imaginary. If `is + ds' is greater than `sizeof(int)*8
1140      - 2', the error handler is called.
1141
1142 `FixedPointComplex::FixedPointComplex (unsigned int is, unsigned int ds, const double r, const double i)'
1143      Create a complex fixed point object with `is' bits for the integer
1144      part and `ds' bits for the decimal part of both real and imaginary
1145      parts, loaded with the fixed point value `r' in the real part and
1146      `i' in the imaginary part. If `is + ds' is greater than
1147      `sizeof(int)*8 - 2', the error handler is called.
1148
1149 `FixedPointComplex::FixedPointComplex (unsigned int is, unsigned int ds, const Complex c)'
1150      Create a complex fixed point object with `is' bits for the integer
1151      part and `ds' bits for the decimal part of both real and imaginary
1152      parts, loaded with the fixed point value `c' in the real and
1153      imaginary parts.  If `is + ds' is greater than `sizeof(int)*8 -
1154      2', the error handler is called.
1155
1156 `FixedPointComplex::FixedPointComplex (unsigned int is, unsigned int ds, const Complex a, const Complex b)'
1157      Create a complex fixed point object with `is' bits for the integer
1158      part and `ds' bits for the decimal part of both real and imaginary
1159      parts, loaded with the fixed point value `a' in the integer parts
1160      of the of the value and `b' in the decimal part. It should be
1161      noted that `a' and `b' are both unsigned and are the strict
1162      representation of the bits of the fixed point value and considered
1163      as integers. If `is + ds' is greater than `sizeof(int)*8 - 2', the
1164      error handler is called.
1165
1166 `FixedPointComplex::FixedPointComplex (const Complex& is, const Complex& ds)'
1167      Create a complex fixed point object with `is' bits for the integer
1168      part and `ds' bits for the decimal part of both real and imaginary
1169      parts, loaded with zero in the real and imaginary parts. The real
1170      part of `is' is used for the real part of the complex fixed point
1171      object, while the imaginary part of `is' is used for the imaginary
1172      part. If either the sum of the real or imaginary parts of `is +
1173      ds' is greater than `sizeof(int)*8 - 2', the error handler is
1174      called.
1175
1176 `FixedPointComplex::FixedPointComplex (const Complex& is, const Complex& ds, const Complex& c)'
1177      Create a complex fixed point object with `is' bits for the integer
1178      part and `ds' bits for the decimal part of both real and imaginary
1179      parts, loaded with the complex fixed point value `c' in the real
1180      and imaginary parts. The real part of `is' is used for the real
1181      part of the complex fixed point object, while the imaginary part
1182      of `is' is used for the imaginary part. If either the sum of the
1183      real or imaginary parts of `is + ds' is greater than
1184      `sizeof(int)*8 - 2', the error handler is called.
1185
1186 `FixedPointComplex::FixedPointComplex (const Complex& is, const Complex& ds, const FixedPointComplex& c)'
1187      Create a complex fixed point object with `is' bits for the integer
1188      part and `ds' bits for the decimal part of both real and imaginary
1189      parts, loaded with the complex fixed point value `c' in the real
1190      and imaginary parts. The real part of `is' is used for the real
1191      part of the complex fixed point object, while the imaginary part
1192      of `is' is used for the imaginary part. If either the sum of the
1193      real or imaginary parts of `is + ds' is greater than
1194      `sizeof(int)*8 - 2', the error handler is called.
1195
1196 `FixedPointComplex::FixedPointComplex (const Complex& is, const Complex& ds, const Complex& a, const Complex& b)'
1197      Create a complex fixed point object with `is' bits for the integer
1198      part and `ds' bits for the decimal part of both real and imaginary
1199      parts, loaded with the fixed point value `a' in the integer parts
1200      of the of the value and `b' in the decimal part. It should be
1201      noted that `a' and `b' are both unsigned and are the strict
1202      representation of the bits of the fixed point value and considered
1203      as integers. If either the sum of the real or imaginary parts of
1204      `is + ds' is greater than `sizeof(int)*8 - 2', the error handler
1205      is called.
1206
1207 `FixedPointComplex::FixedPointComplex (const std::complex<FixedPoint> &c)'
1208      Create a complex fixed point object with the minimum number of
1209      bits for the integer part `is' needed to represent the real and
1210      imaginary integer parts of `x'. If `is' is greater than
1211      `sizeof(int)*8 - 2', the error handler is called. The real and
1212      imaginary parts are treated separately.
1213
1214 `FixedPointComplex::FixedPointComplex (const FixedPointComplex &x)'
1215      Create a copy of the complex fixed point object `x'
1216
1217 `FixedPointComplex::FixedPointComplex (const FixedPoint &x)'
1218      Create a copy of the fixed point object `x', into a complex fixed
1219      point object leaving the imaginary part at zero.
1220
1221 `FixedPointComplex::FixedPointComplex (const FixedPoint &r, const FixedPoint &i)'
1222      Create a copy of the fixed point objects `r' and `i', into a the
1223      real and imaginary parts of a complex fixed point object
1224      respectively
1225
1226 `FixedPointComplex::FixedPointComplex (const int x)'
1227      Create a fixed point object with the minimum number of bits for
1228      the integer part `is' needed to represent `x'. If `is' is greater
1229      than `sizeof(int)*8 - 2', the error handler is called.
1230
1231 `FixedPointComplex::FixedPointComplex (const double x)'
1232      Create a fixed point object with the minimum number of bits for
1233      the integer part `is' needed to represent the integer part of `x'.
1234      If `is' is greater than `sizeof(int)*8 - 2', the error handler is
1235      called.
1236
1237 `FixedPointComplex (const Complex& is, const Complex& ds, const double& d)'
1238      Create a complex fixed point object with `is' bits for the integer
1239      part and `ds' bits for the decimal part of both real and imaginary
1240      parts, loaded with the double value `d' in the real and zero in
1241      the imaginary parts. The real part of `is' is used for the real
1242      part of the complex fixed point object, while the imaginary part
1243      of `is' is used for the imaginary part. If either the sum of the
1244      real or imaginary parts of `is + ds' is greater than
1245      `sizeof(int)*8 - 2', the error handler is called.
1246
1247 \1f
1248 File: fixed.info,  Node: FPCSpecific,  Next: FPCOperators,  Prev: FPCConstructors,  Up: FixedPointComplex
1249
1250 2.2.2 `FixedPointComplex' Specific Methods
1251 ------------------------------------------
1252
1253 `Complex FixedPointComplex::fixedpoint()'
1254      Method to create a `Complex' from the current fixed point object
1255
1256 `Complex fixedpoint (const FixedPointComplex &x)'
1257      Create a `Complex' from the fixed point object `x'
1258
1259 `Complex FixedPointComplex::sign ()'
1260      Return `-1' for negative numbers, `1' for positive and `0' if the
1261      current fixed point object is zero. Real and imaginary parts
1262      treated separately and returned in the real and imaginary parts of
1263      the return object.
1264
1265 `Complex sign (FixedPointComplex &x)'
1266      Return `-1' for negative numbers, `1' for positive and `0' if the
1267      fixed point object `x' is zero. Real and imaginary parts treated
1268      separately and returned in the real and imaginary parts of the
1269      return object.
1270
1271 `Complex FixedPointComplex::getintsize ()'
1272      Return the number of bit `is' used to represent the integer part
1273      of the current fixed point object. Real and imaginary parts
1274      treated separately and returned in the real and imaginary parts of
1275      the return object.
1276
1277 `Complex getintsize (FixedPointComplex &x)'
1278      Return the number of bit `is' used to represent the integer part
1279      of the fixed point object `x'. Real and imaginary parts treated
1280      separately and returned in the real and imaginary parts of the
1281      return object.
1282
1283 `Complex FixedPointComplex::getdecsize ()'
1284      Return the number of bit `ds' used to represent the decimal part
1285      of the current fixed point object.  Real and imaginary parts
1286      treated separately and returned in the real and imaginary parts of
1287      the return object.
1288
1289 `Complex getdecsize (FixedPointComplex &x)'
1290      Return the number of bit `ds' used to represent the decimal part
1291      of the fixed point object `x'. Real and imaginary parts treated
1292      separately and returned in the real and imaginary parts of the
1293      return object.
1294
1295 `Complex FixedPointComplex::getnumber ()'
1296      Return the integer representation of the fixed point value of the
1297      current fixed point object. Real and imaginary parts treated
1298      separately and returned in the real and imaginary parts of the
1299      return object.
1300
1301 `Complex getnumber (FixedPointComplex &x)'
1302      Return the integer representation of the fixed point value of the
1303      fixed point object `x'. Real and imaginary parts treated
1304      separately and returned in the real and imaginary parts of the
1305      return object.
1306
1307 `FixedPointComplex FixedPointComplex::chintsize (const Complex n)'
1308      Return a fixed point object equivalent to the current fixed point
1309      number but with the number of bits representing the integer part
1310      `is' changed to `n'. If the result of this operation causes `is +
1311      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
1312      called.  Real and imaginary parts treated separately and returned
1313      in the real and imaginary parts of the return object.
1314
1315 `FixedPointComplex FixedPointComplex::chdecsize (const Complex n)'
1316      Return a fixed point object equivalent to the current fixed point
1317      number but with the number of bits representing the decimal part
1318      `ds' changed to `n'. If the result of this operation causes `is +
1319      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
1320      called.  Real and imaginary parts treated separately and returned
1321      in the real and imaginary parts of the return object.
1322
1323 `FixedPointComplex FixedPointComplex::incintsize (const Complex n)'
1324      Return a fixed point object equivalent to the current fixed point
1325      number but with the number of bits representing the integer part
1326      `is' increased by `n'. If `n' is negative, then `is' is decreased.
1327      If the result of this operation causes `is + ds' to be greater than
1328      `sizeof(int)*8 - 2', the error handler is called. Real and
1329      imaginary parts treated separately and returned in the real and
1330      imaginary parts of the return object.
1331
1332 `FixedPointComplex FixedPointComplex::incintsize ()'
1333      Return a fixed point object equivalent to the current fixed point
1334      number but with the number of bits representing the integer part
1335      `is' increased by 1. If the result of this operation causes `is +
1336      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
1337      called. Real and imaginary parts treated separately and returned
1338      in the real and imaginary parts of the return object.
1339
1340 `FixedPointComplex FixedPointComplex::incdecsize (const Complex n)'
1341      Return a fixed point object equivalent to the current fixed point
1342      number but with the number of bits representing the decimal part
1343      `ds' increased by `n'. If `n' is negative, then `ds' is decreased.
1344      If the result of this operation causes `is + ds' to be greater than
1345      `sizeof(int)*8 - 2', the error handler is called. Real and
1346      imaginary parts treated separately and returned in the real and
1347      imaginary parts of the return object.
1348
1349 `FixedPointComplex FixedPointComplex::incdecsize ()'
1350      Return a fixed point object equivalent to the current fixed point
1351      number but with the number of bits representing the decimal part
1352      `ds' increased by 1. If the result of this operation causes `is +
1353      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
1354      called. Real and imaginary parts treated separately and returned
1355      in the real and imaginary parts of the return object.
1356
1357 \1f
1358 File: fixed.info,  Node: FPCOperators,  Next: FPCFunctions,  Prev: FPCSpecific,  Up: FixedPointComplex
1359
1360 2.2.3 `FixedPointComplex' Operators
1361 -----------------------------------
1362
1363 `FixedPointComplex operator +'
1364      Unary `+' of a complex fixed point object
1365
1366 `FixedPointComplex operator -'
1367      Unary `-' of a complex fixed point object
1368
1369 `FixedPointComplex operator = (const FixedPointComplex &x)'
1370      Assignment operators. Copies complex fixed point object `x'
1371
1372 `FixedPointComplex operator += (const FixedPointComplex &x)'
1373 `FixedPointComplex operator -= (const FixedPointComplex &x)'
1374 `FixedPointComplex operator *= (const FixedPointComplex &x)'
1375 `FixedPointComplex operator /= (const FixedPointComplex &x)'
1376      Assignment operators, working on both the input and output
1377      objects. The output object's fixed point representation is
1378      promoted such that the largest values of `is' and `ds' are taken
1379      from the input and output objects. If the result of this operation
1380      causes `is + ds' to be greater than `sizeof(int)*8 - 2', the error
1381      handler is called.
1382
1383 `FixedPointComplex operator + (const FixedPointComplex &x, const FixedPointComplex &y)'
1384 `FixedPointComplex operator - (const FixedPointComplex &x, const FixedPointComplex &y)'
1385 `FixedPointComplex operator * (const FixedPointComplex &x, const FixedPointComplex &y)'
1386 `FixedPointComplex operator / (const FixedPointComplex &x, const FixedPointComplex &y)'
1387      Two argument operators. The output objects complex fixed point
1388      representation is promoted such that the largest values of `is'
1389      and `ds' are taken from the two arguments. If the result of this
1390      operation causes `is + ds' to be greater than  `sizeof(int)*8 -
1391      2', the error handler is called.
1392
1393 `bool operator == (const FixedPointComplex &x, const FixedPointComplex &y)'
1394 `bool operator != (const FixedPointComplex &x, const FixedPointComplex &y)'
1395      Complex fixed point comparison operators. The complex fixed point
1396      object `x' and `y' can have different representations (values of
1397      `is' and `ds').
1398
1399 `std::istream &operator >> (std::istream &s, FixedPointComplex &x)'
1400      Read a fixed point object from `s' stream and store it into `x'
1401      keeping the fixed point representation in `x'. If the value read is
1402      not a fixed  point object, the error handler is invoked.
1403
1404 `std::ostream &operator << (std::ostream &s, const FixedPointComplex &x)'
1405      Send into the stream `s', a formatted fixed point value `x'
1406
1407 \1f
1408 File: fixed.info,  Node: FPCFunctions,  Prev: FPCOperators,  Up: FixedPointComplex
1409
1410 2.2.4 `FixedPointComplex' Functions
1411 -----------------------------------
1412
1413 `FixedPoint abs (const FixedPointComplex &x)'
1414      Returns the modulus of `x'
1415
1416 `FixedPoint norm (const FixedPointComplex &x)'
1417      Returns the squared magnitude of `x'
1418
1419 `FixedPoint arg (const FixedPointComplex &x)'
1420      Returns the arc-tangent of `x'
1421
1422 `FixedPointComplex std::polar (const FixedPoint &r, const FixedPoint &p)'
1423      Convert from polar fixed point to a complex fixed point object
1424
1425 `FixedPoint real (const FixedPointComplex &x)'
1426      Returns the real part of `x'
1427
1428 `FixedPoint imag (const FixedPointComplex &x)'
1429      Returns the imaginary part of `x'
1430
1431 `FixedPointComplex conj (const FixedPointComplex &x)'
1432      Returns the conjugate of `x'
1433
1434 `FixedPointComplex cos (const FixedPointComplex &x)'
1435      Returns the transcendental cosine of `x'
1436
1437 `FixedPointComplex cosh (const FixedPointComplex &x)'
1438      Returns the transcendental hyperbolic cosine of `x'
1439
1440 `FixedPointComplex sin (const FixedPointComplex &x)'
1441      Returns the transcendental sine of `x'
1442
1443 `FixedPointComplex sinh (const FixedPointComplex &x)'
1444      Returns the transcendental hyperbolic sine of `x'
1445
1446 `FixedPointComplex tan (const FixedPointComplex &x)'
1447      Returns the transcendental tangent of `x'
1448
1449 `FixedPointComplex tanh (const FixedPointComplex &x)'
1450      Returns the transcendental hyperbolic tangent of `x'
1451
1452 `FixedPointComplex sqrt (const FixedPointComplex &x)'
1453      Returns the square root of `x'
1454
1455 `FixedPointComplex pow (const FixedPointComplex &x, int y)'
1456 `FixedPointComplex pow (const FixedPointComplex &x, const FixedPoint &y)'
1457 `FixedPointComplex pow (const FixedPointComplex &x, const FixedPointComplex &y)'
1458 `FixedPointComplex pow (const FixedPoint &x, const FixedPointComplex &y)'
1459      Returns the `x' raised to the power `y'. Be careful of precision
1460      errors associated with the implementation of this function as a
1461      complex type
1462
1463 `FixedPointComplex exp (const FixedPointComplex &x)'
1464      Returns the exponential of `x'.  Be careful of precision errors
1465      associated with the implementation of this function as a complex
1466      type
1467
1468 `FixedPointComplex log (const FixedPointComplex &x)'
1469      Returns the transcendental logarithm of `x'.  Be careful of
1470      precision errors associated with the implementation of this
1471      function as a complex type
1472
1473 `FixedPointComplex log10 (const FixedPointComplex &x)'
1474      Returns the transcendental base 10 logarithm of `x'. Be careful of
1475      precision errors associated with the implementation of this
1476      function as a complex type
1477
1478 `FixedPointComplex floor (const FixedPointComplex &x)'
1479      Returns the rounded value of `x' downwards to the nearest integer,
1480      treating the real and imaginary parts separately
1481
1482 `FixedPointComplex ceil (const FixedPointComplex &x)'
1483      Returns the rounded value of `x' upwards to the nearest integer,
1484      treating the real and imaginary parts separately
1485
1486 `FixedPointComplex rint (const FixedPointComplex &x)'
1487      Returns the rounded value of `x' to the nearest integer, treating
1488      the real and imaginary parts separately
1489
1490 `FixedPointComplex round (const FixedPointComplex &x)'
1491      Returns the rounded value of `x' to the nearest integer. The
1492      difference with `rint' is that `0.5' is rounded to `1' and not `0'.
1493      This conforms to the behavior of the octave `round' function.
1494      Treats the real and imaginary parts separately
1495
1496 \1f
1497 File: fixed.info,  Node: Derived,  Next: Upper,  Prev: FixedPointComplex,  Up: Programming
1498
1499 2.3 The Derived Classes using the Octave Template Classes
1500 =========================================================
1501
1502 It is not the purpose of this section to discuss the use of the Octave
1503 template classes, but rather only the additions to the fixed point
1504 classes that are based on these. For instance the basic constructors
1505 and operations that are available in the normal floating point Octave
1506 classes are available within the fixed point classes.
1507
1508    The notable exceptions are operations involving matrix
1509 decompositions, including inversion, left division, etc. The reason for
1510 this is that the precision of these operators and functions will be
1511 highly implementation dependent. As additional these operators and
1512 functions are used rarely with a fixed point type, there is no point in
1513 implementing these operators and function within the fixed point
1514 classes.
1515
1516    In addition the the functions and operators previously described for
1517 the `FixedPoint' and the `FixedPointComplex' types are all available,
1518 in the same from as previously. So these functions are not documented
1519 below. Only the constructors and methods that vary from the previously
1520 described versions are described.
1521
1522    To fully understand these classes, the user is advised to examine the
1523 header files `fixedMatrix.h', `fixedRowVector.h' and `fixedColVector.h'
1524 for the real fixed point objects and `fixedCMatrix.h',
1525 `fixedCRowVector.h' and `fixedCColVector.h' for the complex fixed point
1526 objects. In addition the files `MArray.h' and `MArray2.h' from Octave
1527 should also be examined.
1528
1529 * Menu:
1530
1531 * FixedMatrix:: `FixedMatrix' class
1532 * FixedRowVector:: `FixedRowVector' class
1533 * FixedColumnVector:: `FixedColumnVector' class
1534 * FixedComplexMatrix:: `FixedComplexMatrix' class
1535 * FixedComplexRowVector:: `FixedComplexRowVector' class
1536 * FixedComplexColumnVector:: `FixedComplexColumnVector' class
1537
1538 \1f
1539 File: fixed.info,  Node: FixedMatrix,  Next: FixedRowVector,  Prev: Derived,  Up: Derived
1540
1541 2.3.1 `FixedMatrix' class
1542 -------------------------
1543
1544 `FixedMatrix::FixedMatrix (const MArray2<int> &is, const MArray2<int> &ds)'
1545 `FixedMatrix::FixedMatrix (const Matrix &is, const Matrix &ds)'
1546      Create a fixed point matrix with the number of bits in the integer
1547      part of each element represented by `is' and the number in the
1548      decimal part by `ds'. The fixed point elements themselves will be
1549      initialized to zero.
1550
1551 `FixedMatrix::FixedMatrix (unsigned int is, unsigned int ds, const FixedMatrix& a)'
1552 `FixedMatrix::FixedMatrix (const MArray2<int> &is, const MArray2<int> &ds, const FixedMatrix& a)'
1553 `FixedMatrix::FixedMatrix (const Matrix &is, const Matrix &ds, const FixedMatrix& a)'
1554      Create a fixed point matrix with the number of bits in the integer
1555      part of each element represented by `is' and the number in the
1556      decimal part by `ds'. The fixed point elements themselves will be
1557      initialized to the fixed point matrix `a'
1558
1559 `FixedMatrix::FixedMatrix (unsigned int is, unsigned int ds, const Matrix& a)'
1560 `FixedMatrix::FixedMatrix (const MArray2<int> &is, const MArray2<int> &ds, const Matrix& a)'
1561 `FixedMatrix::FixedMatrix (const Matrix &is, const Matrix &ds, const Matrix& a)'
1562      Create a fixed point matrix with the number of bits in the integer
1563      part of each element represented by `is' and the number in the
1564      decimal part by `ds'. The fixed point elements themselves will be
1565      initialized to the matrix `a'
1566
1567 `FixedMatrix::FixedMatrix (unsigned int is, unsigned int ds, const Matrix& a, const Matrix& b)'
1568 `FixedMatrix::FixedMatrix (const MArray2<int> &is, const MArray2<int> &ds, const Matrix& a, const Matrix& b)'
1569 `FixedMatrix::FixedMatrix (const Matrix &is, const Matrix &ds, const Matrix& a, const Matrix& b)'
1570      Create a fixed point matrix with the number of bits in the integer
1571      part of each element represented by `is' and the number in the
1572      decimal part by `ds'. The fixed point elements themselves will
1573      have the integer parts loaded by the matrix `a' and the decimal
1574      part by the matrix `b'. It should be noted that `a' and `b' are
1575      both considered as unsigned integers and are the strict
1576      representation of the bits of the fixed point value.
1577
1578 `Matrix FixedMatrix::fixedpoint ()'
1579      Method to create a `Matrix' from a fixed point matrix `x'
1580
1581 `Matrix fixedpoint (const FixedMatrix &x)'
1582      Create a `Matrix' from a fixed point matrix `x'
1583
1584 `Matrix FixedMatrix::sign ()'
1585      Return `-1' for negative numbers, `1' for positive and `0' if the
1586      fixed point element is zero, for every element of the current
1587      fixed point object.
1588
1589 `Matrix sign (const FixedMatrix &x)'
1590      Return `-1' for negative numbers, `1' for positive and `0' if
1591      zero, for every element of the fixed point object `x'.
1592
1593 `Matrix FixedMatrix::signbit ()'
1594      Return the sign bit for every element of the current fixed point
1595      matrix (`0' for positive number, `1' for negative number).
1596
1597 `Matrix signbit (const FixedMatrix &x)'
1598      Return the sign bit for every element of the fixed point matrix `x'
1599      (`0' for positive number, `1' for negative number).
1600
1601 `Matrix FixedMatrix::getintsize ()'
1602      Return the number of bit `is' used to represent the integer part
1603      of each element of the current fixed point object.
1604
1605 `Matrix getintsize (const FixedMatrix &x)'
1606      Return the number of bit `is' used to represent the integer part
1607      of each element of the fixed point object `x'.
1608
1609 `Matrix FixedMatrix::getdecsize ()'
1610      Return the number of bit `ds' used to represent the decimal part
1611      of each element of the current fixed point object.
1612
1613 `Matrix getdecsize (const FixedMatrix &x)'
1614      Return the number of bit `ds' used to represent the decimal part
1615      of each element of the fixed point object `x'.
1616
1617 `Matrix FixedMatrix::getnumber ()'
1618      Return the integer representation of the fixed point value of the
1619      each eleement of the current fixed point object.
1620
1621 `Matrix getnumber (const FixedMatrix &x)'
1622      Return the integer representation of the fixed point value of the
1623      each eleement of the fixed point object `x'.
1624
1625 `FixedMatrix FixedMatrix::chintsize (const Matrix &n)'
1626 `FixedMatrix FixedMatrix::chintsize (const double n)'
1627      Return a fixed point object equivalent to the current fixed point
1628      object but with the number of bits representing the integer part
1629      `is' of every element changed to `n'. If the result of this
1630      operation causes any element of `is + ds' to be greater than
1631      `sizeof(int)*8 - 2', the error handler is called.
1632
1633 `FixedMatrix FixedMatrix::chdecsize (const double n)'
1634 `FixedMatrix FixedMatrix::chdecsize (const Matrix &n)'
1635      Return a fixed point object equivalent to the current fixed point
1636      object but with the number of bits representing the decimal part
1637      `ds' of every element changed to `n'. If the result of this
1638      operation causes any element of `is + ds' to be greater than
1639      `sizeof(int)*8 - 2', the error handler is called.
1640
1641 `FixedMatrix FixedMatrix::incintsize (const double n)'
1642 `FixedMatrix FixedMatrix::incintsize (const Matrix &n)'
1643      Return a fixed point object equivalent to the current fixed point
1644      number but with the number of bits representing the integer part
1645      `is' increased by `n'. If `n' is negative, then `is' is decreased.
1646      If the result of this operation causes `is + ds' to be greater than
1647      `sizeof(int)*8 - 2', the error handler is called.
1648
1649 `FixedMatrix FixedMatrix::incintsize ()'
1650      Return a fixed point object equivalent to the current fixed point
1651      number but with the number of bits representing the integer part
1652      `is' increased by 1. If the result of this operation causes `is +
1653      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
1654      called.
1655
1656 `FixedMatrix FixedMatrix::incdecsize (const double n)'
1657 `FixedMatrix FixedMatrix::incdecsize (const Matrix &n)'
1658      Return a fixed point object equivalent to the current fixed point
1659      number but with the number of bits representing the decimal part
1660      `ds' increased by `n'. If `n' is negative, then `ds' is decreased.
1661      If the result of this operation causes `is + ds' to be greater than
1662      `sizeof(int)*8 - 2', the error handler is called.
1663
1664 `FixedMatrix FixedMatrix::incdecsize ()'
1665      Return a fixed point object equivalent to the current fixed point
1666      number but with the number of bits representing the decimal part
1667      `ds' increased by 1. If the result of this operation causes `is +
1668      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
1669      called.
1670
1671 \1f
1672 File: fixed.info,  Node: FixedRowVector,  Next: FixedColumnVector,  Prev: FixedMatrix,  Up: Derived
1673
1674 2.3.2 `FixedRowVector' class
1675 ----------------------------
1676
1677 `FixedRowVector::FixedRowVector (const MArray<int> &is, const MArray<int> &ds)'
1678 `FixedRowVector::FixedRowVector (const RowVector &is, const RowVector &ds)'
1679      Create a fixed point row vector with the number of bits in the
1680      integer part of each element represented by `is' and the number in
1681      the decimal part by `ds'. The fixed point elements themselves will
1682      be initialized to zero.
1683
1684 `FixedRowVector::FixedRowVector (unsigned int is, unsigned int ds, const FixedRowVector& a)'
1685 `FixedRowVector::FixedRowVector (const MArray<int> &is, const MArray<int> &ds, const FixedRowVector& a)'
1686 `FixedRowVector::FixedRowVector (const RowVector &is, const RowVector &ds, const FixedRowVector& a)'
1687      Create a fixed point row vector with the number of bits in the
1688      integer part of each element represented by `is' and the number in
1689      the decimal part by `ds'. The fixed point elements themselves will
1690      be initialized to the fixed point row rector `a'
1691
1692 `FixedRowVector::FixedRowVector (unsigned int is, unsigned int ds, const RowVector& a)'
1693 `FixedRowVector::FixedRowVector (const MArray<int> &is, const MArray<int> &ds, const RowVector& a)'
1694 `FixedRowVector::FixedRowVector (const RowVector &is, const RowVector &ds, const RowVector& a)'
1695      Create a fixed point row vector with the number of bits in the
1696      integer part of each element represented by `is' and the number in
1697      the decimal part by `ds'. The fixed point elements themselves will
1698      be initialized to the row vector `a'
1699
1700 `FixedRowVector::FixedRowVector (unsigned int is, unsigned int ds, const RowVector& a, const RowVector& b)'
1701 `FixedRowVector::FixedRowVector (const MArray<int> &is, const MArray<int> &ds, const RowVector& a, const RowVector& b)'
1702 `FixedRowVector::FixedRowVector (const RowVector &is, const RowVector &ds, const RowVector& a, const RowVector& b)'
1703      Create a fixed point row vector with the number of bits in the
1704      integer part of each element represented by `is' and the number in
1705      the decimal part by `ds'. The fixed point elements themselves will
1706      have the integer parts loaded by the row vector `a' and the
1707      decimal part by the row vector `b'. It should be noted that `a'
1708      and `b' are both considered as unsigned integers and are the
1709      strict  representation of the bits of the fixed point value.
1710
1711 `RowVector FixedRowVector::fixedpoint ()'
1712      Method to create a `RowVector' from a fixed point row vector `x'
1713
1714 `RowVector fixedpoint (const FixedRowVector &x)'
1715      Create a `RowVector' from a fixed point row vector `x'
1716
1717 `RowVector FixedRowVector::sign ()'
1718      Return `-1' for negative numbers, `1' for positive and `0' if the
1719      fixed point element is zero, for every element of the current
1720      fixed point object.
1721
1722 `RowVector sign (const FixedRowVector &x)'
1723      Return `-1' for negative numbers, `1' for positive and `0' if
1724      zero, for every element of the fixed point object `x'.
1725
1726 `RowVector FixedRowVector::signbit ()'
1727      Return the sign bit for every element of the current fixed point
1728      row vector (`0' for positive number, `1' for negative number).
1729
1730 `RowVector signbit (const FixedRowVector &x)'
1731      Return the sign bit for every element of the fixed point row
1732      vector `x' (`0' for positive number, `1' for negative number).
1733
1734 `RowVector FixedRowVector::getintsize ()'
1735      Return the number of bit `is' used to represent the integer part
1736      of each element of the current fixed point object.
1737
1738 `RowVector getintsize (const FixedRowVector &x)'
1739      Return the number of bit `is' used to represent the integer part
1740      of each element of the fixed point object `x'.
1741
1742 `RowVector FixedRowVector::getdecsize ()'
1743      Return the number of bit `ds' used to represent the decimal part
1744      of each element of the current fixed point object.
1745
1746 `RowVector getdecsize (const FixedRowVector &x)'
1747      Return the number of bit `ds' used to represent the decimal part
1748      of each element of the fixed point object `x'.
1749
1750 `RowVector FixedRowVector::getnumber ()'
1751      Return the integer representation of the fixed point value of the
1752      each eleement of the current fixed point object.
1753
1754 `RowVector getnumber (const FixedRowVector &x)'
1755      Return the integer representation of the fixed point value of the
1756      each eleement of the fixed point object `x'.
1757
1758 `FixedRowVector FixedRowVector::chintsize (const RowVector n)'
1759 `FixedRowVector FixedRowVector::chintsize (const double n)'
1760      Return a fixed point object equivalent to the current fixed point
1761      object but with the number of bits representing the integer part
1762      `is' of every element changed to `n'. If the result of this
1763      operation causes any element of `is + ds' to be greater than
1764      `sizeof(int)*8 - 2', the error handler is called.
1765
1766 `FixedRowVector FixedRowVector::chdecsize (const double n)'
1767 `FixedRowVector FixedRowVector::chdecsize (const RowVector n)'
1768      Return a fixed point object equivalent to the current fixed point
1769      object but with the number of bits representing the decimal part
1770      `ds' of every element changed to `n'. If the result of this
1771      operation causes any element of `is + ds' to be greater than
1772      `sizeof(int)*8 - 2', the error handler is called.
1773
1774 `FixedRowVector FixedRowVector::incintsize (const double n)'
1775 `FixedRowVector FixedRowVector::incintsize (const RowVector &n)'
1776      Return a fixed point object equivalent to the current fixed point
1777      number but with the number of bits representing the integer part
1778      `is' increased by `n'. If `n' is negative, then `is' is decreased.
1779      If the result of this operation causes `is + ds' to be greater than
1780      `sizeof(int)*8 - 2', the error handler is called.
1781
1782 `FixedRowVector FixedRowVector::incintsize ()'
1783      Return a fixed point object equivalent to the current fixed point
1784      number but with the number of bits representing the integer part
1785      `is' increased by 1. If the result of this operation causes `is +
1786      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
1787      called.
1788
1789 `FixedRowVector FixedRowVector::incdecsize (const double n)'
1790 `FixedRowVector FixedRowVector::incdecsize (const RowVector &n)'
1791      Return a fixed point object equivalent to the current fixed point
1792      number but with the number of bits representing the decimal part
1793      `ds' increased by `n'. If `n' is negative, then `ds' is decreased.
1794      If the result of this operation causes `is + ds' to be greater than
1795      `sizeof(int)*8 - 2', the error handler is called.
1796
1797 `FixedRowVector FixedRowVector::incdecsize ()'
1798      Return a fixed point object equivalent to the current fixed point
1799      number but with the number of bits representing the decimal part
1800      `ds' increased by 1. If the result of this operation causes `is +
1801      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
1802      called.
1803
1804 \1f
1805 File: fixed.info,  Node: FixedColumnVector,  Next: FixedComplexMatrix,  Prev: FixedRowVector,  Up: Derived
1806
1807 2.3.3 `FixedColumnVector' class
1808 -------------------------------
1809
1810 `FixedColumnVector::FixedColumnVector (const MArray<int> &is, const MArray<int> &ds)'
1811 `FixedColumnVector::FixedColumnVector (const ColumnVector &is, const ColumnVector &ds)'
1812      Create a fixed point row vector with the number of bits in the
1813      integer part of each element represented by `is' and the number in
1814      the decimal part by `ds'. The fixed point elements themselves will
1815      be initialized to zero.
1816
1817 `FixedColumnVector::FixedColumnVector (unsigned int is, unsigned int ds, const FixedColumnVector& a)'
1818 `FixedColumnVector::FixedColumnVector (const MArray<int> &is, const MArray<int> &ds, const FixedColumnVector& a)'
1819 `FixedColumnVector::FixedColumnVector (const ColumnVector &is, const ColumnVector &ds, const FixedColumnVector& a)'
1820      Create a fixed point row vector with the number of bits in the
1821      integer part of each element represented by `is' and the number in
1822      the decimal part by `ds'. The fixed point elements themselves will
1823      be initialized to the fixed point column vector `a'
1824
1825 `FixedColumnVector::FixedColumnVector (unsigned int is, unsigned int ds, const ColumnVector& a)'
1826 `FixedColumnVector::FixedColumnVector (const MArray<int> &is, const MArray<int> &ds, const ColumnVector& a)'
1827 `FixedColumnVector::FixedColumnVector (const ColumnVector &is, const ColumnVector &ds, const ColumnVector& a)'
1828      Create a fixed point row vector with the number of bits in the
1829      integer part of each element represented by `is' and the number in
1830      the decimal part by `ds'. The fixed point elements themselves will
1831      be initialized to the column vector `a'
1832
1833 `FixedColumnVector::FixedColumnVector (unsigned int is, unsigned int ds, const ColumnVector& a, const ColumnVector& b)'
1834 `FixedColumnVector::FixedColumnVector (const MArray<int> &is, const MArray<int> &ds, const ColumnVector& a, const ColumnVector& b)'
1835 `FixedColumnVector::FixedColumnVector (const ColumnVector &is, const ColumnVector &ds, const ColumnVector& a, const ColumnVector& b)'
1836      Create a fixed point row vector with the number of bits in the
1837      integer part of each element represented by `is' and the number in
1838      the decimal part by `ds'. The fixed point elements themselves will
1839      have the integer parts loaded by the column vector `a' and the
1840      decimal part by the column vector `b'. It should be noted that `a'
1841      and `b' are both considered  as unsigned integers and are the
1842      strict  representation of the bits of the fixed point value.
1843
1844 `ColumnVector FixedColumnVector::fixedpoint ()'
1845      Method to create a `ColumnVector' from a fixed point column vector
1846      `x'
1847
1848 `ColumnVector fixedpoint (const FixedColumnVector &x)'
1849      Create a `ColumnVector' from a fixed point column vector `x'
1850
1851 `ColumnVector FixedColumnVector::sign ()'
1852      Return `-1' for negative numbers, `1' for positive and `0' if the
1853      fixed point element is zero, for every element of the current
1854      fixed point object.
1855
1856 `ColumnVector sign (const FixedColumnVector &x)'
1857      Return `-1' for negative numbers, `1' for positive and `0' if
1858      zero, for every element of the fixed point object `x'.
1859
1860 `ColumnVector FixedColumnVector::signbit ()'
1861      Return the sign bit for every element of the current fixed point
1862      column vector (`0' for positive number, `1' for negative number).
1863
1864 `ColumnVector signbit (const FixedColumnVector &x)'
1865      Return the sign bit for every element of the fixed point column
1866      vector `x' (`0' for positive number, `1' for negative number).
1867
1868 `ColumnVector FixedColumnVector::getintsize ()'
1869      Return the number of bit `is' used to represent the integer part
1870      of each element of the current fixed point object.
1871
1872 `ColumnVector getintsize (const FixedColumnVector &x)'
1873      Return the number of bit `is' used to represent the integer part
1874      of each element of the fixed point object `x'.
1875
1876 `ColumnVector FixedColumnVector::getdecsize ()'
1877      Return the number of bit `ds' used to represent the decimal part
1878      of each element of the current fixed point object.
1879
1880 `ColumnVector getdecsize (const FixedColumnVector &x)'
1881      Return the number of bit `ds' used to represent the decimal part
1882      of each element of the fixed point object `x'.
1883
1884 `ColumnVector FixedColumnVector::getnumber ()'
1885      Return the integer representation of the fixed point value of the
1886      each eleement of the current fixed point object.
1887
1888 `ColumnVector getnumber (const FixedColumnVector &x)'
1889      Return the integer representation of the fixed point value of the
1890      each eleement of the fixed point object `x'.
1891
1892 `FixedColumnVector FixedColumnVector::chintsize (const ColumnVector n)'
1893 `FixedColumnVector FixedColumnVector::chintsize (const double n)'
1894      Return a fixed point object equivalent to the current fixed point
1895      object but with the number of bits representing the integer part
1896      `is' of every element changed to `n'. If the result of this
1897      operation causes any element of `is + ds' to be greater than
1898      `sizeof(int)*8 - 2', the error handler is called.
1899
1900 `FixedColumnVector FixedColumnVector::chdecsize (const double n)'
1901 `FixedColumnVector FixedColumnVector::chdecsize (const ColumnVector n)'
1902      Return a fixed point object equivalent to the current fixed point
1903      object but with the number of bits representing the decimal part
1904      `ds' of every element changed to `n'. If the result of this
1905      operation causes any element of `is + ds' to be greater than
1906      `sizeof(int)*8 - 2', the error handler is called.
1907
1908 `FixedColumnVector FixedColumnVector::incintsize (const double n)'
1909 `FixedColumnVector FixedColumnVector::incintsize (const ColumnVector &n)'
1910      Return a fixed point object equivalent to the current fixed point
1911      number but with the number of bits representing the integer part
1912      `is' increased by `n'. If `n' is negative, then `is' is decreased.
1913      If the result of this operation causes `is + ds' to be greater than
1914      `sizeof(int)*8 - 2', the error handler is called.
1915
1916 `FixedColumnVector FixedColumnVector::incintsize ()'
1917      Return a fixed point object equivalent to the current fixed point
1918      number but with the number of bits representing the integer part
1919      `is' increased by 1. If the result of this operation causes `is +
1920      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
1921      called.
1922
1923 `FixedColumnVector FixedColumnVector::incdecsize (const double n)'
1924 `FixedColumnVector FixedColumnVector::incdecsize (const ColumnVector &n)'
1925      Return a fixed point object equivalent to the current fixed point
1926      number but with the number of bits representing the decimal part
1927      `ds' increased by `n'. If `n' is negative, then `ds' is decreased.
1928      If the result of this operation causes `is + ds' to be greater than
1929      `sizeof(int)*8 - 2', the error handler is called.
1930
1931 `FixedColumnVector FixedColumnVector::incdecsize ()'
1932      Return a fixed point object equivalent to the current fixed point
1933      number but with the number of bits representing the decimal part
1934      `ds' increased by 1. If the result of this operation causes `is +
1935      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
1936      called.
1937
1938 \1f
1939 File: fixed.info,  Node: FixedComplexMatrix,  Next: FixedComplexRowVector,  Prev: FixedColumnVector,  Up: Derived
1940
1941 2.3.4 `FixedComplexMatrix' class
1942 --------------------------------
1943
1944 `FixedComplexMatrix::FixedComplexMatrix (const MArray2<int> &is, const MArray2<int> &ds)'
1945 `FixedComplexMatrix::FixedComplexMatrix (const Matrix &is, const Matrix &ds)'
1946      Create a complex fixed point matrix with the number of bits in the
1947      integer part of the real and imaginary part of each element
1948      represented by `is' and the number in the decimal part by `ds'.
1949      The fixed point elements themselves will be initialized to zero.
1950
1951 `FixedComplexMatrix::FixedComplexMatrix (const ComplexMatrix &is, const ComplexMatrix &ds)'
1952      Create a complex fixed point matrix with the number of bits in the
1953      integer part of each element represented by `is' and the number in
1954      the decimal part by `ds'. The fixed point elements themselves will
1955      be initialized to zero.
1956
1957 `FixedComplexMatrix::FixedComplexMatrix (unsigned int is, unsigned int ds, const FixedComplexMatrix& a)'
1958 `FixedComplexMatrix::FixedComplexMatrix (Complex is, Complex ds, const FixedComplexMatrix& a)'
1959
1960 `FixedComplexMatrix::FixedComplexMatrix (const MArray2<int> &is, const MArray2<int> &ds, const FixedComplexMatrix& a)'
1961 `FixedComplexMatrix::FixedComplexMatrix (const Matrix &is, const Matrix &ds, const FixedComplexMatrix& a)'
1962      Create a complex fixed point matrix with the number of bits in the
1963      integer part of the real and imaginary part of each element
1964      represented by `is' and the number in the decimal part by `ds'.
1965      The fixed point elements themselves will be initialized to the
1966      complex fixed point matrix `a'
1967
1968 `FixedComplexMatrix::FixedComplexMatrix (const ComplexMatrix &is, const ComplexMatrix &ds, const FixedComplexMatrix &x)'
1969 `FixedComplexMatrix::FixedComplexMatrix (const ComplexMatrix &is, const ComplexMatrix &ds, const FixedMatrix &r, const FixedMatrix &i)'
1970      Create a complex fixed point matrix with the number of bits in the
1971      integer part of each element represented by `is' and the number in
1972      the decimal part by `ds'. The fixed point elements themselves will
1973      be initialized to the complex fixed point matrix `a', or the real
1974      part by `r' and the imaginary by `i'.
1975
1976 `FixedComplexMatrix::FixedComplexMatrix (unsigned int is, unsigned int ds, const FixedMatrix& a)'
1977 `FixedComplexMatrix::FixedComplexMatrix (Complex is, Complex ds, const FixedMatrix& a)'
1978
1979 `FixedComplexMatrix::FixedComplexMatrix (const MArray2<int> &is, const MArray2<int> &ds, const FixedMatrix& a)'
1980 `FixedComplexMatrix::FixedComplexMatrix (const Matrix &is, const Matrix &ds, const FixedMatrix& a)'
1981      Create a complex fixed point matrix with the number of bits in the
1982      integer part of the real and imaginary part of each element
1983      represented by `is' and the number in the decimal part by `ds'.
1984      The fixed point elements themselves will be initialized to the
1985      fixed point matrix `a'
1986
1987 `FixedComplexMatrix::FixedComplexMatrix (const ComplexMatrix &is, const ComplexMatrix &ds, const FixedMatrix &x)'
1988      Create a complex fixed point matrix with the number of bits in the
1989      integer part of each element represented by `is' and the number in
1990      the decimal part by `ds'. The fixed point elements themselves will
1991      be initialized to the fixed point matrix `a'.
1992
1993 `FixedComplexMatrix::FixedComplexMatrix (unsigned int is, unsigned int ds, const ComplexMatrix& a)'
1994 `FixedComplexMatrix::FixedComplexMatrix (Complex is, Complex ds, const ComplexMatrix& a)'
1995 `FixedComplexMatrix::FixedComplexMatrix (const MArray2<int> &is, const MArray2<int> &ds, const ComplexMatrix& a)'
1996 `FixedComplexMatrix::FixedComplexMatrix (const ComplexMatrix &is, const ComplexMatrix &ds, const ComplexMatrix& a)'
1997      Create a complex fixed point matrix with the number of bits in the
1998      integer part of the real and imaginary part of each element
1999      represented by `is' and the number in the decimal part by `ds'.
2000      The fixed point elements themselves will be initialized to the
2001      complex matrix `a'
2002
2003 `FixedComplexMatrix::FixedComplexMatrix (const ComplexMatrix &is, const ComplexMatrix &ds, const ComplexMatrix &x)'
2004 `FixedComplexMatrix::FixedComplexMatrix (const ComplexMatrix &is, const ComplexMatrix &ds, const Matrix &r, const Matrix &i)'
2005      Create a complex fixed point matrix with the number of bits in the
2006      integer part of each element represented by `is' and the number in
2007      the decimal part by `ds'. The fixed point elements themselves will
2008      be initialized to the complex matrix `a', or the real part by `r'
2009      and the imaginary by `i'.
2010
2011 `FixedComplexMatrix::FixedComplexMatrix (unsigned int is, unsigned int ds, const Matrix& a)'
2012 `FixedComplexMatrix::FixedComplexMatrix (Complex is, Complex ds, const Matrix& a)'
2013 `FixedComplexMatrix::FixedComplexMatrix (const MArray2<int> &is, const MArray2<int> &ds, const Matrix& a)'
2014 `FixedComplexMatrix::FixedComplexMatrix (const ComplexMatrix &is, const ComplexMatrix &ds, const Matrix& a)'
2015      Create a complex fixed point matrix with the number of bits in the
2016      integer part of the real and imaginary part of each element
2017      represented by `is' and the number in the decimal part by `ds'.
2018      The fixed point elements themselves will be initialized to the
2019      matrix `a'
2020
2021 `FixedComplexMatrix::FixedComplexMatrix (const ComplexMatrix &is, const ComplexMatrix &ds, const Matrix &x)'
2022      Create a complex fixed point matrix with the number of bits in the
2023      integer part of each element represented by `is' and the number in
2024      the decimal part by `ds'. The fixed point elements themselves will
2025      be initialized to the matrix `a'.
2026
2027 `FixedComplexMatrix::FixedComplexMatrix (unsigned int is, unsigned int ds, const ComplexMatrix& a, const ComplexMatrix& b)'
2028 `FixedComplexMatrix::FixedComplexMatrix (Complex is, Complex ds, const ComplexMatrix& a, const ComplexMatrix& b)'
2029 `FixedComplexMatrix::FixedComplexMatrix (const MArray2<int> &is, const MArray2<int> &ds, const ComplexMatrix& a, const ComplexMatrix& b)'
2030
2031 `FixedComplexMatrix::FixedComplexMatrix (const Matrix &is, const Matrix &ds, const ComplexMatrix& a, const ComplexMatrix& b)'
2032 `FixedComplexMatrix::FixedComplexMatrix (const ComplexMatrix &is, const ComplexMatrix &ds, const ComplexMatrix& a, const ComplexMatrix& b)'
2033      Create a fixed point matrix with the number of bits in the integer
2034      part of each element represented by `is' and the number in the
2035      decimal part by `ds'.The fixed point elements themselves will have
2036      the integer parts loaded by the complex matrix `a' and the decimal
2037      part by the complex matrix `b'. It should be noted that `a' and
2038      `b' are both considered as unsigned complex integers and are the
2039      strict representation of the bits of the fixed point value.
2040
2041 `ComplexMatrix FixedComplexMatrix::fixedpoint ()'
2042      Method to create a `Matrix' from a fixed point matrix `x'
2043
2044 `ComplexMatrix fixedpoint (const FixedComplexMatrix &x)'
2045      Create a `Matrix' from a fixed point matrix `x'
2046
2047 `ComplexMatrix FixedComplexMatrix::sign ()'
2048      Return `-1' for negative numbers, `1' for positive and `0' if the
2049      fixed point element is zero, for every element of the current
2050      fixed point object.
2051
2052 `ComplexMatrix sign (const FixedComplexMatrix &x)'
2053      Return `-1' for negative numbers, `1' for positive and `0' if
2054      zero, for every element of the fixed point object `x'.
2055
2056 `ComplexMatrix FixedComplexMatrix::getintsize ()'
2057      Return the number of bit `is' used to represent the integer part
2058      of each element of the current fixed point object.
2059
2060 `ComplexMatrix getintsize (const FixedComplexMatrix &x)'
2061      Return the number of bit `is' used to represent the integer part
2062      of each element of the fixed point object `x'.
2063
2064 `ComplexMatrix FixedComplexMatrix::getdecsize ()'
2065      Return the number of bit `ds' used to represent the decimal part
2066      of each element of the current fixed point object.
2067
2068 `ComplexMatrix getdecsize (const FixedComplexMatrix &x)'
2069      Return the number of bit `ds' used to represent the decimal part
2070      of each element of the fixed point object `x'.
2071
2072 `ComplexMatrix FixedComplexMatrix::getnumber ()'
2073      Return the integer representation of the fixed point value of the
2074      each eleement of the current fixed point object.
2075
2076 `ComplexMatrix getnumber (const FixedComplexMatrix &x)'
2077      Return the integer representation of the fixed point value of the
2078      each eleement of the fixed point object `x'.
2079
2080 `FixedComplexMatrix FixedComplexMatrix::chintsize (const ComplexMatrix &n)'
2081 `FixedComplexMatrix FixedComplexMatrix::chintsize (const double n)'
2082      Return a fixed point object equivalent to the current fixed point
2083      object but with the number of bits representing the integer part
2084      `is' of every element changed to `n'. If the result of this
2085      operation causes any element of `is + ds' to be greater than
2086      `sizeof(int)*8 - 2', the error handler is called.
2087
2088 `FixedComplexMatrix FixedComplexMatrix::chdecsize (const double n)'
2089 `FixedComplexMatrix FixedComplexMatrix::chdecsize (const ComplexMatrix &n)'
2090      Return a fixed point object equivalent to the current fixed point
2091      object but with the number of bits representing the decimal part
2092      `ds' of every element changed to `n'. If the result of this
2093      operation causes any element of `is + ds' to be greater than
2094      `sizeof(int)*8 - 2', the error handler is called.
2095
2096 `FixedComplexMatrix FixedComplexMatrix::incintsize (const double n)'
2097 `FixedComplexMatrix FixedComplexMatrix::incintsize (const ComplexMatrix &n)'
2098      Return a fixed point object equivalent to the current fixed point
2099      number but with the number of bits representing the integer part
2100      `is' increased by `n'. If `n' is negative, then `is' is decreased.
2101      If the result of this operation causes `is + ds' to be greater than
2102      `sizeof(int)*8 - 2', the error handler is called.
2103
2104 `FixedComplexMatrix FixedComplexMatrix::incintsize ()'
2105      Return a fixed point object equivalent to the current fixed point
2106      number but with the number of bits representing the integer part
2107      `is' increased by 1. If the result of this operation causes `is +
2108      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
2109      called.
2110
2111 `FixedComplexMatrix FixedComplexMatrix::incdecsize (const double n)'
2112 `FixedComplexMatrix FixedComplexMatrix::incdecsize (const ComplexMatrix &n)'
2113      Return a fixed point object equivalent to the current fixed point
2114      number but with the number of bits representing the decimal part
2115      `ds' increased by `n'. If `n' is negative, then `ds' is decreased.
2116      If the result of this operation causes `is + ds' to be greater than
2117      `sizeof(int)*8 - 2', the error handler is called.
2118
2119 `FixedComplexMatrix FixedComplex::incdecsize ()'
2120      Return a fixed point object equivalent to the current fixed point
2121      number but with the number of bits representing the decimal part
2122      `ds' increased by 1. If the result of this operation causes `is +
2123      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
2124      called.
2125
2126 \1f
2127 File: fixed.info,  Node: FixedComplexRowVector,  Next: FixedComplexColumnVector,  Prev: FixedComplexMatrix,  Up: Derived
2128
2129 2.3.5 `FixedComplexRowVector' class
2130 -----------------------------------
2131
2132 `FixedComplexRowVector::FixedComplexRowVector (const MArray<int> &is, const MArray<int> &ds)'
2133 `FixedComplexRowVector::FixedComplexRowVector (const RowVector &is, const RowVector &ds)'
2134      Create a complex fixed point row vector with the number of bits in
2135      the integer part of the real and imaginary part of each element
2136      represented by `is' and the number in the decimal part by `ds'.
2137      The fixed point elements themselves will be initialized to zero.
2138
2139 `FixedComplexRowVector::FixedComplexRowVector (const ComplexRowVector &is, const ComplexRowVector &ds)'
2140      Create a complex fixed point row vector with the number of bits in
2141      the integer part of each element represented by `is' and the
2142      number in the decimal part by `ds'. The fixed point elements
2143      themselves will be initialized to zero.
2144
2145 `FixedComplexRowVector::FixedComplexRowVector (unsigned int is, unsigned int ds, const FixedComplexRowVector& a)'
2146 `FixedComplexRowVector::FixedComplexRowVector (Complex is, Complex ds, const FixedComplexRowVector& a)'
2147 `FixedComplexRowVector::FixedComplexRowVector (const MArray<int> &is, const MArray<int> &ds, const FixedComplexRowVector& a)'
2148 `FixedComplexRowVector::FixedComplexRowVector (const RowVector &is, const RowVector &ds, const FixedComplexRowVector& a)'
2149      Create a complex fixed point row vector with the number of bits in
2150      the integer part of the real and imaginary part of each element
2151      represented by `is' and the number in the decimal part by `ds'.
2152      The fixed point elements themselves will be initialized to the
2153      complex fixed point row vector `a'
2154
2155 `FixedComplexRowVector::FixedComplexRowVector (const ComplexRowVector &is, const ComplexRowVector &ds, const FixedComplexRowVector &x)'
2156 `FixedComplexRowVector::FixedComplexRowVector (const ComplexRowVector &is, const ComplexRowVector &ds, const FixedRowVector &r, const FixedRowVector &i)'
2157      Create a complex fixed point row vector with the number of bits in
2158      the integer part of each element represented by `is' and the
2159      number in the decimal part by `ds'. The fixed point elements
2160      themselves will be initialized to the complex fixed point row
2161      vector `a', or the real part by `r' and the imaginary by `i'.
2162
2163 `FixedComplexRowVector::FixedComplexRowVector (unsigned int is, unsigned int ds, const FixedRowVector& a)'
2164 `FixedComplexRowVector::FixedComplexRowVector (Complex is, Complex ds, const FixedRowVector& a)'
2165 `FixedComplexRowVector::FixedComplexRowVector (const MArray<int> &is, const MArray<int> &ds, const FixedRowVector& a)'
2166 `FixedComplexRowVector::FixedComplexRowVector (const RowVector &is, const RowVector &ds, const FixedRowVector& a)'
2167      Create a complex fixed point row vector with the number of bits in
2168      the integer part of the real and imaginary part of each element
2169      represented by `is' and the number in the decimal part by `ds'.
2170      The fixed point elements themselves will be initialized to the
2171      fixed point row vector `a'
2172
2173 `FixedComplexRowVector::FixedComplexRowVector (const ComplexRowVector &is, const ComplexRowVector &ds, const FixedRowVector &x)'
2174      Create a complex fixed point row vector with the number of bits in
2175      the integer part of each element represented by `is' and the
2176      number in the decimal part by `ds'. The fixed point elements
2177      themselves will be initialized to the fixed point row vector `a'.
2178
2179 `FixedComplexRowVector::FixedComplexRowVector (unsigned int is, unsigned int ds, const ComplexRowVector& a)'
2180 `FixedComplexRowVector::FixedComplexRowVector (Complex is, Complex ds, const ComplexRowVector& a)'
2181 `FixedComplexRowVector::FixedComplexRowVector (const MArray<int> &is, const MArray<int> &ds, const ComplexRowVector& a)'
2182 `FixedComplexRowVector::FixedComplexRowVector (const ComplexRowVector &is, const ComplexRowVector &ds, const ComplexRowVector& a)'
2183      Create a complex fixed point row vector with the number of bits in
2184      the integer part of the real and imaginary part of each element
2185      represented by `is' and the number in the decimal part by `ds'.
2186      The fixed point elements themselves will be initialized to the
2187      complex row vector `a'
2188
2189 `FixedComplexRowVector::FixedComplexRowVector (const ComplexRowVector &is, const ComplexRowVector &ds, const ComplexRowVector &x)'
2190 `FixedComplexRowVector::FixedComplexRowVector (const ComplexRowVector &is, const ComplexRowVector &ds, const RowVector &r, const RowVector &i)'
2191      Create a complex fixed point row vector with the number of bits in
2192      the integer part of each element represented by `is' and the
2193      number in the decimal part by `ds'. The fixed point elements
2194      themselves will be initialized to the complex row vector `a', or
2195      the real part by `r' and the imaginary by `i'.
2196
2197 `FixedComplexRowVector::FixedComplexRowVector (unsigned int is, unsigned int ds, const RowVector& a)'
2198 `FixedComplexRowVector::FixedComplexRowVector (Complex is, Complex ds, const RowVector& a)'
2199 `FixedComplexRowVector::FixedComplexRowVector (const MArray<int> &is, const MArray<int> &ds, const RowVector& a)'
2200 `FixedComplexRowVector::FixedComplexRowVector (const ComplexRowVector &is, const ComplexRowVector &ds, const RowVector& a)'
2201      Create a complex fixed point row vector with the number of bits in
2202      the integer part of the real and imaginary part of each element
2203      represented by `is' and the number in the decimal part by `ds'.
2204      The fixed point elements themselves will be initialized to the row
2205      vector `a'
2206
2207 `FixedComplexRowVector::FixedComplexRowVector (const ComplexRowVector &is, const ComplexRowVector &ds, const RowVector &x)'
2208      Create a complex fixed point row vector with the number of bits in
2209      the integer part of each element represented by `is' and the
2210      number in the decimal part by `ds'. The fixed point elements
2211      themselves will be initialized to the row vector `a'.
2212
2213 `FixedComplexRowVector::FixedComplexRowVector (unsigned int is, unsigned int ds, const ComplexRowVector& a, const ComplexRowVector& b)'
2214 `FixedComplexRowVector::FixedComplexRowVector (Complex is, Complex ds, const ComplexRowVector& a, const ComplexRowVector& b)'
2215 `FixedComplexRowVector::FixedComplexRowVector (const MArray<int> &is, const MArray<int> &ds, const ComplexRowVector& a, const ComplexRowVector& b)'
2216 `FixedComplexRowVector::FixedComplexRowVector (const RowVector &is, const RowVector &ds, const ComplexRowVector& a, const ComplexRowVector& b)'
2217 `FixedComplexRowVector::FixedComplexRowVector (const ComplexRowVector &is, const ComplexRowVector &ds, const ComplexRowVector& a, const ComplexRowVector& b)'
2218      Create a fixed point row vector with the number of bits in the
2219      integer part of each element represented by `is' and the number in
2220      the decimal part by `ds'. The fixed point elements themselves will
2221      have the integer parts loaded by the complex row vector `a' and
2222      the decimal part by the complex row vector `b'. It should be noted
2223      that `a' and `b' are both considered as unsigned complex integers
2224      and are the strict representation of the bits of the fixed point
2225      value.
2226
2227 `ComplexRowVector FixedComplexRowVector::fixedpoint ()'
2228      Method to create a `RowVector' from a fixed point row vector `x'
2229
2230 `ComplexRowVector fixedpoint (const FixedComplexRowVector &x)'
2231      Create a `RowVector' from a fixed point row vector `x'
2232
2233 `ComplexRowVector FixedComplexRowVector::sign ()'
2234      Return `-1' for negative numbers, `1' for positive and `0' if the
2235      fixed point element is zero, for every element of the current
2236      fixed point object.
2237
2238 `ComplexRowVector sign (const FixedComplexRowVector &x)'
2239      Return `-1' for negative numbers, `1' for positive and `0' if
2240      zero, for every element of the fixed point object `x'.
2241
2242 `ComplexRowVector FixedComplexRowVector::getintsize ()'
2243      Return the number of bit `is' used to represent the integer part
2244      of each element of the current fixed point object.
2245
2246 `ComplexRowVector getintsize (const FixedComplexRowVector &x)'
2247      Return the number of bit `is' used to represent the integer part
2248      of each element of the fixed point object `x'.
2249
2250 `ComplexRowVector FixedComplexRowVector::getdecsize ()'
2251      Return the number of bit `ds' used to represent the decimal part
2252      of each element of the current fixed point object.
2253
2254 `ComplexRowVector getdecsize (const FixedComplexRowVector &x)'
2255      Return the number of bit `ds' used to represent the decimal part
2256      of each element of the fixed point object `x'.
2257
2258 `ComplexRowVector getdecsize (const FixedComplexRowVector &x)'
2259      Return the number of bit `ds' used to represent the decimal part
2260      of each element of the fixed point object `x'.
2261
2262 `ComplexRowVector FixedComplexRowVector::getnumber ()'
2263      Return the integer representation of the fixed point value of the
2264      each eleement of the current fixed point object.
2265
2266 `FixedComplexRowVector FixedComplexRowVector::chintsize (const ComplexRowVector &n)'
2267 `FixedComplexRowVector FixedComplexRowVector::chintsize (const double n)'
2268      Return a fixed point object equivalent to the current fixed point
2269      object but with the number of bits representing the integer part
2270      `is' of every element changed to `n'. If the result of this
2271      operation causes any element of `is + ds' to be greater than
2272      `sizeof(int)*8 - 2', the error handler is called.
2273
2274 `FixedComplexRowVector FixedComplexRowVector::chdecsize (const double n)'
2275 `FixedComplexRowVector FixedComplexRowVector::chdecsize (const ComplexRowVector &n)'
2276      Return a fixed point object equivalent to the current fixed point
2277      object but with the number of bits representing the decimal part
2278      `ds' of every element changed to `n'. If the result of this
2279      operation causes any element of `is + ds' to be greater than
2280      `sizeof(int)*8 - 2', the error handler is called.
2281
2282 `FixedComplexRowVector FixedComplexRowVector::incintsize (const Complex n)'
2283 `FixedComplexRowVector FixedComplexRowVector::incintsize (const ComplexRowVector &n)'
2284      Return a fixed point object equivalent to the current fixed point
2285      number but with the number of bits representing the integer part
2286      `is' increased by `n'. If `n' is negative, then `is' is decreased.
2287      If the result of this operation causes `is + ds' to be greater than
2288      `sizeof(int)*8 - 2', the error handler is called.
2289
2290 `FixedComplexRowVector FixedComplexRowVector::incintsize ()'
2291      Return a fixed point object equivalent to the current fixed point
2292      number but with the number of bits representing the integer part
2293      `is' increased by 1. If the result of this operation causes `is +
2294      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
2295      called.
2296
2297 `FixedComplexRowVector FixedComplexRowVector::incdecsize (const Complex n)'
2298 `FixedComplexRowVector FixedComplexRowVector::incdecsize (const ComplexRowVector &n)'
2299      Return a fixed point object equivalent to the current fixed point
2300      number but with the number of bits representing the decimal part
2301      `ds' increased by `n'. If `n' is negative, then `ds' is decreased.
2302      If the result of this operation causes `is + ds' to be greater than
2303      `sizeof(int)*8 - 2', the error handler is called.
2304
2305 `FixedComplexRowVector FixedComplexRowVector::incdecsize ()'
2306      Return a fixed point object equivalent to the current fixed point
2307      number but with the number of bits representing the decimal part
2308      `ds' increased by 1. If the result of this operation causes `is +
2309      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
2310      called.
2311
2312 \1f
2313 File: fixed.info,  Node: FixedComplexColumnVector,  Prev: FixedComplexRowVector,  Up: Derived
2314
2315 2.3.6 `FixedComplexColumnVector' class
2316 --------------------------------------
2317
2318 `FixedComplexColumnVector::FixedComplexColumnVector (const MArray<int> &is, const MArray<int> &ds)'
2319 `FixedComplexColumnVector::FixedComplexColumnVector (const ColumnVector &is, const ColumnVector &ds)'
2320      Create a complex fixed point column vector with the number of bits
2321      in the integer part of the real and imaginary part of each element
2322      represented by `is' and the number in the decimal part by `ds'.
2323      The fixed point elements themselves will be initialized to zero.
2324
2325 `FixedComplexColumnVector::FixedComplexColumnVector (const ComplexColumnVector &is, const ComplexColumnVector &ds)'
2326      Create a complex fixed point column vector with the number of bits
2327      in the integer part of each element represented by `is' and the
2328      number in the decimal part by `ds'. The fixed point elements
2329      themselves will be initialized to zero.
2330
2331 `FixedComplexColumnVector::FixedComplexColumnVector (unsigned int is, unsigned int ds, const FixedComplexColumnVector& a)'
2332 `FixedComplexColumnVector::FixedComplexColumnVector (Complex is, Complex ds, const FixedComplexColumnVector& a)'
2333 `FixedComplexColumnVector::FixedComplexColumnVector (const MArray<int> &is, const MArray<int> &ds, const FixedComplexColumnVector& a)'
2334 `FixedComplexColumnVector::FixedComplexColumnVector (const ColumnVector &is, const ColumnVector &ds, const FixedComplexColumnVector& a)'
2335      Create a complex fixed point column vector with the number of bits
2336      in the integer part of the real and imaginary part of each element
2337      represented by `is' and the number in the decimal part by `ds'.
2338      The fixed point elements themselves will be initialized to the
2339      complex fixed point column vector `a'
2340
2341 `FixedComplexColumnVector::FixedComplexColumnVector (const ComplexColumnVector &is, const ComplexColumnVector &ds, const FixedComplexColumnVector &x)'
2342 `FixedComplexColumnVector::FixedComplexColumnVector (const ComplexColumnVector &is, const ComplexColumnVector &ds, const FixedColumnVector &r, const FixedColumnVector &i)'
2343      Create a complex fixed point column vector with the number of bits
2344      in the integer part of each element represented by `is' and the
2345      number in the decimal part by `ds'. The fixed point elements
2346      themselves will be initialized to the complex fixed point column
2347      vector `a', or the real part by `r' and the imaginary by `i'.
2348
2349 `FixedComplexColumnVector::FixedComplexColumnVector (unsigned int is, unsigned int ds, const FixedColumnVector& a)'
2350 `FixedComplexColumnVector::FixedComplexColumnVector (Complex is, Complex ds, const FixedColumnVector& a)'
2351 `FixedComplexColumnVector::FixedComplexColumnVector (const MArray<int> &is, const MArray<int> &ds, const FixedColumnVector& a)'
2352 `FixedComplexColumnVector::FixedComplexColumnVector (const ColumnVector &is, const ColumnVector &ds, const FixedColumnVector& a)'
2353      Create a complex fixed point column vector with the number of bits
2354      in the integer part of the real and imaginary part of each element
2355      represented by `is' and the number in the decimal part by `ds'.
2356      The fixed point elements themselves will be initialized to the
2357      fixed point column vector `a'
2358
2359 `FixedComplexColumnVector::FixedComplexColumnVector (const ComplexColumnVector &is, const ComplexColumnVector &ds, const FixedColumnVector &x)'
2360      Create a complex fixed point column vector with the number of bits
2361      in the integer part of each element represented by `is' and the
2362      number in the decimal part by `ds'. The fixed point elements
2363      themselves will be initialized to the fixed point column vector
2364      `a'.
2365
2366 `FixedComplexColumnVector::FixedComplexColumnVector (unsigned int is, unsigned int ds, const ComplexColumnVector& a)'
2367 `FixedComplexColumnVector::FixedComplexColumnVector (Complex is, Complex ds, const ComplexColumnVector& a)'
2368 `FixedComplexColumnVector::FixedComplexColumnVector (const MArray<int> &is, const MArray<int> &ds, const ComplexColumnVector& a)'
2369 `FixedComplexColumnVector::FixedComplexColumnVector (const ComplexColumnVector &is, const ComplexColumnVector &ds, const ComplexColumnVector& a)'
2370      Create a complex fixed point column vector with the number of bits
2371      in the integer part of the real and imaginary part of each element
2372      represented by `is' and the number in the decimal part by `ds'.
2373      The fixed point elements themselves will be initialized to the
2374      complex column vector `a'
2375
2376 `FixedComplexColumnVector::FixedComplexColumnVector (const ComplexColumnVector &is, const ComplexColumnVector &ds, const ComplexColumnVector &x)'
2377 `FixedComplexColumnVector::FixedComplexColumnVector (const ComplexColumnVector &is, const ComplexColumnVector &ds, const ColumnVector &r, const ColumnVector &i)'
2378      Create a complex fixed point column vector with the number of bits
2379      in the integer part of each element represented by `is' and the
2380      number in the decimal part by `ds'. The fixed point elements
2381      themselves will be initialized to the complex column vector `a',
2382      or the real part by `r' and the imaginary by `i'.
2383
2384 `FixedComplexColumnVector::FixedComplexColumnVector (unsigned int is, unsigned int ds, const ColumnVector& a)'
2385 `FixedComplexColumnVector::FixedComplexColumnVector (Complex is, Complex ds, const ColumnVector& a)'
2386
2387 `FixedComplexColumnVector::FixedComplexColumnVector (const MArray<int> &is, const MArray<int> &ds, const ColumnVector& a)'
2388 `FixedComplexColumnVector::FixedComplexColumnVector (const ComplexColumnVector &is, const ComplexColumnVector &ds, const ColumnVector& a)'
2389      Create a complex fixed point column vector with the number of bits
2390      in the integer part of the real and imaginary part of each element
2391      represented by `is' and the number in the decimal part by `ds'.
2392      The fixed point elements themselves will be initialized to the
2393      column vector `a'
2394
2395 `FixedComplexColumnVector::FixedComplexColumnVector (const ComplexColumnVector &is, const ComplexColumnVector &ds, const ColumnVector &x)'
2396      Create a complex fixed point column vector with the number of bits
2397      in the integer part of each element represented by `is' and the
2398      number in the decimal part by `ds'. The fixed point elements
2399      themselves will be initialized to the column vector `a'.
2400
2401 `FixedComplexColumnVector::FixedComplexColumnVector (unsigned int is, unsigned int ds, const ComplexColumnVector& a, const ComplexColumnVector& b)'
2402 `FixedComplexColumnVector::FixedComplexColumnVector (Complex is, Complex ds, const ComplexColumnVector& a, const ComplexColumnVector& b)'
2403 `FixedComplexColumnVector::FixedComplexColumnVector (const MArray<int> &is, const MArray<int> &ds, const ComplexColumnVector& a, const ComplexColumnVector& b)'
2404 `FixedComplexColumnVector::FixedComplexColumnVector (const ColumnVector &is, const ColumnVector &ds, const ComplexColumnVector& a, const ComplexColumnVector& b)'
2405 `FixedComplexColumnVector::FixedComplexColumnVector (const ComplexColumnVector &is, const ComplexColumnVector &ds, const ComplexColumnVector& a, const ComplexColumnVector& b)'
2406      Create a fixed point column vector with the number of bits in the
2407      integer part of each element represented by `is' and the number in
2408      the decimal part by `ds'. The fixed point elements themselves will
2409      have the integer parts loaded by the complex column vector `a' and
2410      the decimal part by the compelx column vector `b'. It should be
2411      noted that `a' and `b' are both considered  as unsigned compelx
2412      integers and are the strict representation of the bits of the
2413      fixed point value.
2414
2415 `ComplexColumnVector FixedComplexColumnVector::fixedpoint ()'
2416      Method to create a `ColumnVector' from a fixed point column vector
2417      `x'
2418
2419 `ComplexColumnVector fixedpoint (const FixedComplexColumnVector &x)'
2420      Create a `ColumnVector' from a fixed point column vector `x'
2421
2422 `ComplexColumnVector FixedComplexColumnVector::sign ()'
2423      Return `-1' for negative numbers, `1' for positive and `0' if the
2424      fixed point element is zero, for every element of the current
2425      fixed point object.
2426
2427 `ComplexColumnVector sign (const FixedComplexColumnVector &x)'
2428      Return `-1' for negative numbers, `1' for positive and `0' if
2429      zero, for every element of the fixed point object `x'.
2430
2431 `ComplexColumnVector FixedComplexColumnVector::getintsize ()'
2432      Return the number of bit `is' used to represent the integer part
2433      of each element of the current fixed point object.
2434
2435 `ComplexColumnVector getintsize (const FixedComplexColumnVector &x)'
2436      Return the number of bit `is' used to represent the integer part
2437      of each element of the fixed point object `x'.
2438
2439 `ComplexColumnVector FixedComplexColumnVector::getdecsize ()'
2440      Return the number of bit `ds' used to represent the decimal part
2441      of each element of the current fixed point object.
2442
2443 `ComplexColumnVector getdecsize (const FixedComplexColumnVector &x)'
2444      Return the number of bit `ds' used to represent the decimal part
2445      of each element of the fixed point object `x'.
2446
2447 `ComplexColumnVector FixedComplexColumnVector::getnumber ()'
2448      Return the integer representation of the fixed point value of the
2449      each eleement of the current fixed point object.
2450
2451 `ComplexColumnVector getnumber (const FixedComplexColumnVector &x)'
2452      Return the integer representation of the fixed point value of the
2453      each eleement of the fixed point object `x'.
2454
2455 `FixedComplexColumnVector FixedComplexColumnVector::chintsize (const ComplexColumnVector &n)'
2456 `FixedComplexColumnVector FixedComplexColumnVector::chintsize (const double n)'
2457      Return a fixed point object equivalent to the current fixed point
2458      object but with the number of bits representing the integer part
2459      `is' of every element changed to `n'. If the result of this
2460      operation causes any element of `is + ds' to be greater than
2461      `sizeof(int)*8 - 2', the error handler is called.
2462
2463 `FixedComplexColumnVector FixedComplexColumnVector::chdecsize (const double n)'
2464 `FixedComplexColumnVector FixedComplexColumnVector::chdecsize (const ComplexColumnVector &n)'
2465      Return a fixed point object equivalent to the current fixed point
2466      object but with the number of bits representing the decimal part
2467      `ds' of every element changed to `n'. If the result of this
2468      operation causes any element of `is + ds' to be greater than
2469      `sizeof(int)*8 - 2', the error handler is called.
2470
2471 `FixedComplexColumnVector FixedComplexColumnVector::incintsize (const double n)'
2472 `FixedComplexColumnVector FixedComplexColumnVector::incintsize (const ComplexColumnVector &n)'
2473      Return a fixed point object equivalent to the current fixed point
2474      number but with the number of bits representing the integer part
2475      `is' increased by `n'. If `n' is negative, then `is' is decreased.
2476      If the result of this operation causes `is + ds' to be greater than
2477      `sizeof(int)*8 - 2', the error handler is called.
2478
2479 `FixedComplexColumnVector FixedComplexColumnVector::incintsize ()'
2480      Return a fixed point object equivalent to the current fixed point
2481      number but with the number of bits representing the integer part
2482      `is' increased by 1. If the result of this operation causes `is +
2483      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
2484      called.
2485
2486 `FixedComplexColumnVector FixedComplexColumnVector::incdecsize (const double n)'
2487 `FixedComplexColumnVector FixedComplexColumnVector::incdecsize (const ComplexColumnVector &n)'
2488      Return a fixed point object equivalent to the current fixed point
2489      number but with the number of bits representing the decimal part
2490      `ds' increased by `n'. If `n' is negative, then `ds' is decreased.
2491      If the result of this operation causes `is + ds' to be greater than
2492      `sizeof(int)*8 - 2', the error handler is called.
2493
2494 `FixedComplexColumnVector FixedComplexColumnVector::incdecsize ()'
2495      Return a fixed point object equivalent to the current fixed point
2496      number but with the number of bits representing the decimal part
2497      `ds' increased by 1. If the result of this operation causes `is +
2498      ds' to be greater than `sizeof(int)*8 - 2', the error handler is
2499      called.
2500
2501 \1f
2502 File: fixed.info,  Node: Upper,  Next: Oct-files,  Prev: Derived,  Up: Programming
2503
2504 2.4 The Upper Level Octave Classes
2505 ==================================
2506
2507 There are 4 upper level classes that define the interface of the fixed
2508 point type to the octave interpreter. These mirror similar definitions
2509 for floating values in octave and are
2510
2511    `octave_fixed'                     -> `octave_scalar'
2512    `octave_fixed_complex'             -> `octave_complex'
2513    `octave_fixed_matrix'              -> `octave_matrix'
2514    `octave_fixed_complex_matrix'      -> `octave_complex_matrix'
2515
2516    These fixed point classes use the same base classes as the
2517 corresponding floating classes, and so have similar capabilities.
2518 However, one notable addition are the methods to obtain the base fixed
2519 point objects from these classes, and also correspond to similar
2520 floating point methods. These are
2521
2522    `fixed_value'                      -> `scalar_value'
2523    `fixed_complex_value'              -> `complex_value'
2524    `fixed_matrix_value'               -> `matrix_value'
2525    `fixed_complex_matrix_value'       -> `complex_matrix_value'
2526
2527    and can be used in all fixed point classes, subject to a possible
2528 reduction operations (eg. casts a `FixedComplexMatrix' as a
2529 `FixedPoint').  In addition the methods `scalar_value', `complex_value',
2530 `matrix_value' and `complex_matrix_value' can all be used.
2531
2532    The user should examine the files `ov-fixed-cx-mat.h',
2533 `ov-fixed-complex.h',  `ov-fixed-mat.h' and `ov-fixed.h' and the base
2534 classes  in the files `ov-base-fixed.h', `ov-base-fixed-mat.h', and
2535 file `ov-base.h' within octave to see the methods that are available
2536 for the upper level classes.
2537
2538 \1f
2539 File: fixed.info,  Node: Oct-files,  Prev: Upper,  Up: Programming
2540
2541 2.5 Writing Oct-files with the Fixed Point Type
2542 ===============================================
2543
2544 It is not the purpose of this section to discuss how to write an
2545 oct-file, or discuss what they are, but rather the specifics of using
2546 oct-files with the fixed point type. An oct-file is a means of writing
2547 an octave function in a compilable language like C++, rather than as a
2548 script file. This results in a significant acceleration in the code.
2549 The reader is referred to the tutorial available at
2550 `http://octave.sourceforge.net/coda/coda.html'.  The examples discussed
2551 here assume that the oct-file is written entirely in C++.
2552
2553 * Menu:
2554
2555 * Templates:: Using C++ Templates in Oct-files
2556 * Problems:: Specific Problems of Oct-files using Fixed Point
2557 * Cygwin:: Specific points to note when using Oct-files and Cygwin
2558 * OctExample:: A Simple Example of an Oct-file
2559
2560 \1f
2561 File: fixed.info,  Node: Templates,  Next: Problems,  Prev: Oct-files,  Up: Oct-files
2562
2563 2.5.1 Using C++ Templates in Oct-files
2564 --------------------------------------
2565
2566 When using the fixed point toolbox, you will almost certainly want to
2567 compare an implementation in fixed-point against the corresponding
2568 implementation in floating point. This allows the degradation due to
2569 the conversion to a fixed-point algorithm to be easily observed. The
2570 concept of C++ templates allows easy implementation of both fixed and
2571 floating point versions of the same code. For example consider
2572
2573      template <class A, class B>
2574      A myfunc(const A &a, const B &b) {
2575        return (a + b);
2576      }
2577
2578      // Floating point instantiations
2579      template double myfunc (const double&, const double&);
2580      template Complex myfunc (const Complex&, const double&);
2581      template Matrix myfunc (const Matrix&, const double&);
2582      template ComplexMatrix myfunc (const ComplexMatrix&, const double&);
2583
2584      // Fixed point instantiations
2585      template FixedPoint myfunc (const FixedPoint&, const FixedPoint&);
2586      template FixedPointComplex myfunc (const FixedPointComplex&,
2587                                    const FixedPoint&);
2588      template FixedMatrix myfunc (const FixedMatrix&, const FixedPoint&);
2589      template FixedComplexMatrix myfunc (const FixedComplexMatrix&,
2590                                     const FixedPoint&);
2591
2592    Eight versions of the function `myfunc' are created, that allow its
2593 use with all floating and fixed types.
2594
2595 \1f
2596 File: fixed.info,  Node: Problems,  Next: Cygwin,  Prev: Templates,  Up: Oct-files
2597
2598 2.5.2 Specific Problems of Oct-files using Fixed Point
2599 ------------------------------------------------------
2600
2601 The fact that the fixed point type is loadable, means that the symbols
2602 of this type are not available till the first use of a fixed point
2603 variable. This means that the function "fixed" must be called at least
2604 once prior to accessing fixed point values in an oct-file.  If a user
2605 function is called, that uses a fixed point type, before the type is
2606 loaded the result will be an error message complaining of unknown
2607 symbols. For example
2608
2609      octave:1> fixed_inc(a)
2610      error: /home/dbateman/octave/fixed/fixed_inc.oct: undefined symbol:
2611      _ZN24octave_base_fixed_matrixI18FixedComplexMatrixE7subsref
2612      ERKSsRKSt4listI17octave_value_listSaIS5_EE
2613      error: `fixed_inc' undefined near line 1 column 1
2614
2615    This should not in itself result in an abnormal exit from Octave.
2616
2617    Another problem when accessing fixed point variables within
2618 oct-files, is that the Octave `octave_value' class knows nothing about
2619 this type.  So you can not directly call a method such as
2620 `fixed_value()' on the input arguments, but rather must cast the
2621 representation of the `octave_value' as a fixed type and then call the
2622 relevant method.  An example of extracting a fixed point value from an
2623 `octave_value' variable `arg' is then
2624
2625        octave_value arg;
2626        ...
2627        if (arg.type_id () == octave_fixed::static_type_id ()) {
2628          FixedPoint f = ((const octave_fixed&) arg.get_rep()).fixed_value();
2629
2630    Similarly, the return value from an oct-file is itself either an
2631 `octave_value' or an `octave_value_list'. So a special means of
2632 creating the return value must be used. For example
2633
2634        octave_value_list retval;
2635        Matrix m;
2636        FixedPoint f;
2637        ...
2638        retval(0) = octave_value(m);
2639        retval(1) = new octave_fixed (f);
2640
2641 \1f
2642 File: fixed.info,  Node: Cygwin,  Next: OctExample,  Prev: Problems,  Up: Oct-files
2643
2644 2.5.3 Specific points to note when using Oct-files and Cygwin
2645 -------------------------------------------------------------
2646
2647 When using the GNU C++ compiler under Cygwin to create a shared object,
2648 such as an oct-file, the symbols must be resolved at compile time. This
2649 is as opposed to a Unix platform where the resolution of the symbols
2650 can be left till runtime. For this reason the fixed point type, when
2651 built under Cygwin is split into an oct-file and a shared library
2652 called `liboctave_fixed.dll'. This is as opposed to the situation under
2653 Unix, where only the Oct-file containing all of the fixed point type is
2654 needed.
2655
2656    This has the implication that when you build an Oct-file under Cygwin
2657 using the fixed point type, that they must be linked to
2658 `liboctave_fixed.dll'. An appropriate means to do this is for example
2659
2660      % mkoctfile -loctave_fixed myfile.cc
2661
2662    The file `liboctave_fixed.dll' and `liboctave_fixed.dll.a' must be
2663 located somewhere that the compiler can find them. If these are
2664 installed in the same directory as `liboctave.dll' and
2665 `liboctave.dll.a' respectively, then `mkoctfile' will find them
2666 automatically.
2667
2668 \1f
2669 File: fixed.info,  Node: OctExample,  Prev: Cygwin,  Up: Oct-files
2670
2671 2.5.4 A Simple Example of an Oct-file
2672 -------------------------------------
2673
2674 An example of a simple oct-file written in C++ using the fixed point
2675 type can be seen below. It integrates the ideas discussed previously.
2676
2677      #include <octave/config.h>
2678      #include <octave/oct.h>
2679      #include "fixed.h"
2680
2681      template <class A, class B>
2682      A myfunc(const A &a, const B &b) {
2683        return (a + b);
2684      }
2685
2686      // Floating point instantiations
2687      template double myfunc (const double&, const double&);
2688      template Complex myfunc (const Complex&, const double&);
2689      template Matrix myfunc (const Matrix&, const double&);
2690      template ComplexMatrix myfunc (const ComplexMatrix&, const double&);
2691
2692      // Fixed point instantiations
2693      template FixedPoint myfunc (const FixedPoint&, const FixedPoint&);
2694      template FixedPointComplex myfunc (const FixedPointComplex&,
2695                                    const FixedPoint&);
2696      template FixedMatrix myfunc (const FixedMatrix&, const FixedPoint&);
2697      template FixedComplexMatrix myfunc (const FixedComplexMatrix&,
2698                                     const FixedPoint&);
2699
2700      DEFUN_DLD (fixed_inc, args, ,
2701      "-*- texinfo -*-\n\
2702      @deftypefn {Loadable Function} {@var{y} =}  fixed_inc (@var{x})\n\
2703      Example code of the use of the fixed point types in an oct-file.\n\
2704      Returns @code{@var{x} + 1}\n\
2705      @end deftypefn")
2706      {
2707        octave_value retval;
2708        FixedPoint one(1,0,1,0);  // Fixed Point value of 1
2709
2710        if (args.length() != 1)
2711          print_usage("fixed_inc");
2712        else
2713          if (args(0).type_id () == octave_fixed_matrix::static_type_id ()) {
2714            FixedMatrix f = ((const octave_fixed_matrix&) args(0).get_rep()).
2715              fixed_matrix_value();
2716            retval = new octave_fixed_matrix (myfunc(f,one));
2717          } else if (args(0).type_id () == octave_fixed::static_type_id ()) {
2718            FixedPoint f = ((const octave_fixed&) args(0).get_rep()).
2719              fixed_value();
2720            retval = new octave_fixed (myfunc(f,one));
2721          } else if (args(0).type_id () ==
2722                      octave_fixed_complex::static_type_id ()) {
2723            FixedPointComplex f = ((const octave_fixed_complex&)
2724                              args(0).get_rep()).fixed_complex_value();
2725            retval = new octave_fixed_complex (myfunc(f,one));
2726          } else if (args(0).type_id () ==
2727                      octave_fixed_complex_matrix::static_type_id ()) {
2728            FixedComplexMatrix f = ((const octave_fixed_complex_matrix&)
2729                      args(0).get_rep()).fixed_complex_matrix_value();
2730            retval = new octave_fixed_complex_matrix (myfunc(f,one));
2731          } else {
2732            // promote the operation to complex matrix. The narrowing op in
2733            // octave_value will later change the type if needed. This is not
2734            // optimal but is convenient....
2735            ComplexMatrix f = args(0).complex_matrix_value();
2736            retval = octave_value (myfunc(f,1.));
2737          }
2738        return retval;
2739      }
2740
2741 \1f
2742 File: fixed.info,  Node: Example,  Next: Function Reference,  Prev: Programming,  Up: Top
2743
2744 3 Fixed Point Type Applied to Real Signal Processing Example
2745 ************************************************************
2746
2747 As an example of the use of the fixed point toolbox applied to a real
2748 signal processing example, we consider the implementation of a Radix-4
2749 IFFT in an OFDM modulator. Code for this IFFT has been written as a C++
2750 template class, and integrated as an Octave Oct-file.  This allowed a
2751 single version of the code to be instantiated to perform both the fixed
2752 and floating point implementations of the same code. The instantiations
2753 of this class are
2754
2755      template Fft<double,Complex,ComplexRowVector>;
2756      template Fft<FixedPoint,FixedPointComplex,FixedComplexRowVector>;
2757
2758      template Ifft<double,Complex,ComplexRowVector>;
2759      template Ifft<FixedPoint,FixedPointComplex,FixedComplexRowVector>;
2760
2761    The code for this example is available as part of the release of this
2762 software package.
2763
2764    A particular problem of a hardware implementation of an IFFT is that
2765 each butterfly in the radix-4 IFFT consists of the summation of four
2766 terms with a suitable phase. Thus, an additional 2 output bits are
2767 potentially needed after each butterfly of the radix-4 IFFT. There are
2768 several ways of addressing this issue
2769
2770   1. Increase the number of bits in the fixed point representation by
2771      two after each radix-4 butterfly. There are then two ways of
2772      treating these added bits:
2773
2774        A. Accept them and let the size of the representation of the
2775           fixed point numbers grows. For large IFFT's this is not
2776           acceptable
2777
2778        B. Cut the least significant bits of representation, either
2779           after each butterfly, or after groups of butterflies. This
2780           reduces the number of bits in the representation, but still
2781           trades off complexity to avoid an overflow condition
2782
2783   2. Keep the fixed point representation used in the IFFT fixed, but
2784      reduce the input signal level to avoid overflows. The IFFT can
2785      then have internal overflows.
2786
2787    An overflow will cause a bit-error which is not necessarily
2788 critical. The last option is therefore attractive in that it allows the
2789 minimum complexity in the hardware implementation of the IFFT. However,
2790 careful investigation of the overflow effects are needed, which can be
2791 performed with the fixed point toolbox.
2792
2793    The table below shows the case of a 64QAM OFDM signal similar to that
2794 used in the 802.11a standard. In this table the OFDM modulator has been
2795 represented using fixed point, while the rest of the system is assumed
2796 to be perfect. The table shows the tradeoff between the backoff of the
2797 RMS power in the frequency domain signal relative to the fixed point
2798 representation for several different fixed point representations.
2799
2800         Backoff        BER            BER            BER
2801         dB             8+1 Bits       10+1 Bits      12+1 Bits
2802         ------         -------        --------       --------
2803         5.00           2.11e-01       2.27e-01       2.30e-01
2804         6.00           1.09e-01       1.18e-01       1.21e-01
2805         7.00           4.23e-02       5.25e-02       5.53e-02
2806         8.00           1.17e-02       1.36e-02       1.48e-02
2807         9.00           5.34e-03       2.21e-03       2.33e-03
2808         10.00          7.49e-03       3.78e-04       3.71e-04
2809         11.00          1.22e-02       0.00e+00       0.00e+00
2810         12.00          2.00e-02       0.00e+00       0.00e+00
2811         13.00          3.12e-02       0.00e+00       0.00e+00
2812         14.00          4.34e-02       0.00e+00       0.00e+00
2813         15.00          6.12e-02       2.31e-07       0.00e+00
2814         16.00          7.53e-02       2.31e-06       0.00e+00
2815         17.00          9.00e-02       1.87e-05       0.00e+00
2816         18.00          1.15e-01       5.56e-05       0.00e+00
2817         19.00          1.30e-01       4.69e-04       0.00e+00
2818         20.00          1.55e-01       1.30e-03       0.00e+00
2819         21.00          1.84e-01       2.96e-03       0.00e+00
2820         22.00          1.98e-01       7.41e-03       0.00e+00
2821         23.00          2.30e-01       1.09e-02       0.00e+00
2822         24.00          2.50e-01       1.99e-02       0.00e+00
2823         25.00          2.73e-01       2.99e-02       0.00e+00
2824         26.00          2.99e-01       4.38e-02       0.00e+00
2825         27.00          3.39e-01       6.09e-02       2.31e-07
2826         28.00          3.51e-01       7.57e-02       2.31e-06
2827         29.00          3.86e-01       8.99e-02       9.72e-06
2828         30.00          3.97e-01       1.16e-01       6.99e-05
2829
2830    Two regions are clearly visible in this table. When the backoff of
2831 the RMS power is small, the effects of the overflow in the IFFT
2832 dominate, and reduce the performance. When the backoff is large, there
2833 are fewer bits in the fixed point representation relative to the
2834 average signal power and therefore a slow degradation in the
2835 performance. It is clear that somewhere between 11 and 13 bits in the
2836 representation of the fixed point numbers in the IFFT is optimal, with a
2837 backoff of approximately 13dB.
2838
2839 \1f
2840 File: fixed.info,  Node: Function Reference,  Prev: Example,  Up: Top
2841
2842 4 Function Reference
2843 ********************
2844
2845 * Menu:
2846
2847 * concat::      Concatenate two matrices regardless of their type.
2848 * create_lookup_table:: Creates a lookup table betwen the vectors X and Y.
2849 * display_fixed_operations:: Displays out a summary of the number of fixed
2850                 point operations of each type that have been used.
2851 * fabs::        Compute the magnitude of the fixed point value X.
2852 * fangle::      See "farg".
2853 * farg::        Compute the argument of X, defined as THETA = `atan2 (Y,
2854                 X)' in radians.
2855 * fatan2::      Compute atan (Y / X) for corresponding fixed point elements
2856                 of Y and X.
2857 * fceil::       Return the smallest integer not less than X.
2858 * fconj::       Returns the conjuate of the fixed point value X.
2859 * fcos::        Compute the cosine of the fixed point value X.
2860 * fcosh::       Compute the hyperbolic cosine of the fixed point value X.
2861 * fcumprod::    Cumulative product of elements along dimension DIM.
2862 * fcumsum::     Cumulative sum of elements along dimension DIM.
2863 * fdiag::       Return a diagonal matrix with fixed point vector V on
2864                 diagonal K.
2865 * fexp::        Compute the exponential of the fixed point value X.
2866 * ffft::        Radix-4 fft in floating and fixed point for vectors of
2867                 length 4^N, where N is an integer.
2868 * ffloor::      Return the largest integer not greater than X.
2869 * fifft::       Radix-4 ifft in fixed point for vectors of length 4^N,
2870                 where.
2871 * fimag::       Returns the imaginary part of the fixed point value X.
2872 * fixed::       Used the create a fixed point variable.
2873 * fixed_inc::   Example code of the use of the fixed point types in an
2874                 oct-file.
2875 * fixed_point_count_operations:: Query or set the internal variable
2876                 `fixed_point_count_operations'.
2877 * fixed_point_debug:: Query or set the internal variable
2878                 `fixed_point_debug'.
2879 * fixed_point_library_version:: A function returning the version number of
2880                 the fixed point library used.
2881 * fixed_point_version:: A function returning the version number of the
2882                 fixed point package used.
2883 * fixed_point_warn_overflow:: Query or set the internal variable
2884                 `fixed_point_warn_overflow'.
2885 * fixedpoint::  Manual and test code for the Octave Fixed Point toolbox.
2886 * float::       Converts a fixed point object to the equivalent floating
2887                 point object.
2888 * flog::        Compute the natural logarithm of the fixed point value X.
2889 * flog10::      Compute the base-10 logarithm of the fixed point value X.
2890 * fprod::       Product of elements along dimension DIM.
2891 * freal::       Returns the real part of the fixed point value X.
2892 * freshape::    Return a fixed matrix with M rows and N columns whose
2893                 elements are taken from the fixed matrix A.
2894 * fround::      Return the rounded value to the nearest integer of X.
2895 * fsin::        Compute the sine of the fixed point value X.
2896 * fsinh::       Compute the hyperbolic sine of the fixed point value X.
2897 * fsort::       Return a copy of the fixed point variable X with the
2898                 elements arranged in increasing order.
2899 * fsqrt::       Compute the square-root of the fixed point value X.
2900 * fsum::        Sum of elements along dimension DIM.
2901 * fsumsq::      Sum of squares of elements along dimension DIM.
2902 * ftan::        Compute the tan of the fixed point value X.
2903 * ftanh::       Compute the hyperbolic tan of the fixed point value X.
2904 * isfixed::     Return 1 if the value of the expression EXPR is a fixed
2905                 point value.
2906 * lookup_table:: Using the lookup table created by "create_lookup_table",
2907                 find the value Y corresponding to X.
2908 * reset_fixed_operations:: Reset the count of fixed point operations to
2909                 zero.
2910
2911 \1f
2912 File: fixed.info,  Node: concat,  Next: create_lookup_table,  Up: Function Reference
2913
2914 4.0.1 concat
2915 ------------
2916
2917  -- Function File: X = concat (A, B)
2918  -- Function File: X = concat (A, B, DIM)
2919      Concatenate two matrices regardless of their type. Due to the
2920      implementation of the matrix concatenation in Octave being
2921      hard-coded for the types it knowns, user types can not use the
2922      matrix concatenation operator. Thus for the _Galois_ and _Fixed
2923      Point_ types, the in-built matrix concatenation functions will
2924      return a matrix value as their solution
2925
2926      This function allows these types to be concatenated. If called
2927      with a user type that is not known by this function, the in-built
2928      concatenate function is used
2929
2930      If DIM is 1, then the matrices are concatenated, else if DIM is 2,
2931      they are stacked
2932
2933 \1f
2934 File: fixed.info,  Node: create_lookup_table,  Next: display_fixed_operations,  Prev: concat,  Up: Function Reference
2935
2936 4.0.2 create_lookup_table
2937 -------------------------
2938
2939  -- Function File: TABLE = create_lookup_table (X, Y)
2940      Creates a lookup table betwen the vectors X and Y. If X is not in
2941      increasing order, the vectors are sorted before being stored
2942
2943 \1f
2944 File: fixed.info,  Node: display_fixed_operations,  Next: fabs,  Prev: create_lookup_table,  Up: Function Reference
2945
2946 4.0.3 display_fixed_operations
2947 ------------------------------
2948
2949  -- Loadable Function:  display_fixed_operations ( )
2950      Displays out a summary of the number of fixed point operations of
2951      each type that have been used. This can be used to give a estimate
2952      of the complexity of an algorithm.
2953 See also: fixed_point_count_operations, reset_fixed_operations
2954
2955 \1f
2956 File: fixed.info,  Node: fabs,  Next: fangle,  Prev: display_fixed_operations,  Up: Function Reference
2957
2958 4.0.4 fabs
2959 ----------
2960
2961  -- Loadable Function: Y = fabs (X)
2962      Compute the magnitude of the fixed point value X.
2963
2964 \1f
2965 File: fixed.info,  Node: fangle,  Next: farg,  Prev: fabs,  Up: Function Reference
2966
2967 4.0.5 fangle
2968 ------------
2969
2970  -- Loadable Function: Y = fangle (X)
2971      See "farg".
2972
2973 \1f
2974 File: fixed.info,  Node: farg,  Next: fatan2,  Prev: fangle,  Up: Function Reference
2975
2976 4.0.6 farg
2977 ----------
2978
2979  -- Loadable Function: Y = farg (X)
2980      Compute the argument of X, defined as THETA = `atan2 (Y, X)' in
2981      radians. For example
2982
2983           farg (fixed (3,5,3+4i))
2984                 =>  0.90625
2985
2986 \1f
2987 File: fixed.info,  Node: fatan2,  Next: fceil,  Prev: farg,  Up: Function Reference
2988
2989 4.0.7 fatan2
2990 ------------
2991
2992  -- Loadable Function:  fatan2 (Y, X)
2993      Compute atan (Y / X) for corresponding fixed point elements of Y
2994      and X.  The result is in range -pi to pi.
2995
2996 \1f
2997 File: fixed.info,  Node: fceil,  Next: fconj,  Prev: fatan2,  Up: Function Reference
2998
2999 4.0.8 fceil
3000 -----------
3001
3002  -- Loadable Function: Y = fceil (X)
3003      Return the smallest integer not less than X.
3004 See also: fround, ffloor
3005
3006 \1f
3007 File: fixed.info,  Node: fconj,  Next: fcos,  Prev: fceil,  Up: Function Reference
3008
3009 4.0.9 fconj
3010 -----------
3011
3012  -- Loadable Function: Y = fconj (X)
3013      Returns the conjuate of the fixed point value X.
3014
3015 \1f
3016 File: fixed.info,  Node: fcos,  Next: fcosh,  Prev: fconj,  Up: Function Reference
3017
3018 4.0.10 fcos
3019 -----------
3020
3021  -- Loadable Function: Y = fcos (X)
3022      Compute the cosine of the fixed point value X.
3023 See also: fcosh, fsin, fsinh, ftan, ftanh
3024
3025 \1f
3026 File: fixed.info,  Node: fcosh,  Next: fcumprod,  Prev: fcos,  Up: Function Reference
3027
3028 4.0.11 fcosh
3029 ------------
3030
3031  -- Loadable Function: Y = fcosh (X)
3032      Compute the hyperbolic cosine of the fixed point value X.
3033 See also: fcos, fsin, fsinh, ftan, ftanh
3034
3035 \1f
3036 File: fixed.info,  Node: fcumprod,  Next: fcumsum,  Prev: fcosh,  Up: Function Reference
3037
3038 4.0.12 fcumprod
3039 ---------------
3040
3041  -- Loadable Function: Y = fcumprod (X,DIM)
3042      Cumulative product of elements along dimension DIM.  If DIM is
3043      omitted, it defaults to 1 (column-wise cumulative products).
3044 See also: fcumsum
3045
3046 \1f
3047 File: fixed.info,  Node: fcumsum,  Next: fdiag,  Prev: fcumprod,  Up: Function Reference
3048
3049 4.0.13 fcumsum
3050 --------------
3051
3052  -- Loadable Function: Y = fcumsum (X,DIM)
3053      Cumulative sum of elements along dimension DIM.  If DIM is
3054      omitted, it defaults to 1 (column-wise cumulative sums).
3055 See also: fcumprod
3056
3057 \1f
3058 File: fixed.info,  Node: fdiag,  Next: fexp,  Prev: fcumsum,  Up: Function Reference
3059
3060 4.0.14 fdiag
3061 ------------
3062
3063  -- Loadable Function:  fdiag (V, K)
3064      Return a diagonal matrix with fixed point vector V on diagonal K.
3065      The second argument is optional. If it is positive, the vector is
3066      placed on the K-th super-diagonal. If it is negative, it is placed
3067      on the -K-th sub-diagonal.  The default value of K is 0, and the
3068      vector is placed on the main diagonal.  For example,
3069
3070           fdiag (fixed(3,2,[1, 2, 3]), 1)
3071           ans =
3072
3073             0.00  1.00  0.00  0.00
3074             0.00  0.00  2.00  0.00
3075             0.00  0.00  0.00  3.00
3076             0.00  0.00  0.00  0.00
3077
3078      Note that if all of the elements of the original vector have the
3079      same fixed point representation, then the zero elements in the
3080      matrix are created with the same representation. Otherwise the
3081      zero elements are created with the equivalent of the fixed point
3082      value `fixed(0,0,0)'.n
3083 See also: diag
3084
3085 \1f
3086 File: fixed.info,  Node: fexp,  Next: ffft,  Prev: fdiag,  Up: Function Reference
3087
3088 4.0.15 fexp
3089 -----------
3090
3091  -- Loadable Function: Y = fexp (X)
3092      Compute the exponential of the fixed point value X.
3093 See also: log, log10, pow
3094
3095 \1f
3096 File: fixed.info,  Node: ffft,  Next: ffloor,  Prev: fexp,  Up: Function Reference
3097
3098 4.0.16 ffft
3099 -----------
3100
3101  -- Loadable Function: Y = ffft (X)
3102      Radix-4 fft in floating and fixed point for vectors of length 4^N,
3103      where N is an integer. The variable X can be a either a row of
3104      column vector, in which case a single fft is carried out over the
3105      vector of length 4^N. If X is a matrix, the fft is carried on each
3106      column of X and the matrix must contain 4^N rows.
3107
3108      The radix-4 fft is implemented in a manner that attempts to
3109      approximate how it will be implemented in hardware, rather than
3110      use a generic butterfly.  The radix-4 algorithm is faster and more
3111      precise than the equivalent radix-2 algorithm, and thus is
3112      preferred for hardware implementation.  See also: fifft
3113
3114 \1f
3115 File: fixed.info,  Node: ffloor,  Next: fifft,  Prev: ffft,  Up: Function Reference
3116
3117 4.0.17 ffloor
3118 -------------
3119
3120  -- Loadable Function: Y = ffloor (X)
3121      Return the largest integer not greater than X.
3122 See also: fround, fceil
3123
3124 \1f
3125 File: fixed.info,  Node: fifft,  Next: fimag,  Prev: ffloor,  Up: Function Reference
3126
3127 4.0.18 fifft
3128 ------------
3129
3130  -- Loadable Function: Y = fifft (X)
3131      Radix-4 ifft in fixed point for vectors of length 4^N, where.  N
3132      is an integer. The variable X can be a either a row of column
3133      vector, in which case a single ifft is carried out over the vector
3134      of length 4^N. If X is a matrix, the ifft is carried on each
3135      column of X and the matrix must contain 4^N rows.
3136
3137      The radix-4 ifft is implemented in a manner that attempts to
3138      approximate how it will be implemented in hardware, rather than
3139      use a generic butterfly.  The radix-4 algorithm is faster and more
3140      precise than the equivalent radix-2 algorithm, and thus is
3141      preferred for hardware implementation.  See also: ffft
3142
3143 \1f
3144 File: fixed.info,  Node: fimag,  Next: fixed,  Prev: fifft,  Up: Function Reference
3145
3146 4.0.19 fimag
3147 ------------
3148
3149  -- Loadable Function: Y = fimag (X)
3150      Returns the imaginary part of the fixed point value X.
3151
3152 \1f
3153 File: fixed.info,  Node: fixed,  Next: fixed_inc,  Prev: fimag,  Up: Function Reference
3154
3155 4.0.20 fixed
3156 ------------
3157
3158  -- Loadable Function: Y = fixed (F)
3159  -- Loadable Function: Y = fixed (IS,DS)
3160  -- Loadable Function: Y = fixed (IS,DS,F)
3161      Used the create a fixed point variable. Called with a single
3162      argument, if F is itself a fixed point value, then "fixed" is
3163      equivalent to `Y = F'. Otherwise the integer part of F is used to
3164      create a fixed point variable with the minimum number of bits
3165      needed to represent it. F can be either real of complex.
3166
3167      Called with two or more arguments IS represents the number of bits
3168      used to represent the integer part of the fixed point numbers, and
3169      DS the number used to represent the decimal part. These variables
3170      must be either positive integer scalars or matrices. If they are
3171      matrices they must be of the same dimension, and each fixed point
3172      number in the created matrix will have the representation given by
3173      the corresponding values of IS and DS.
3174
3175      When creating complex fixed point values, the fixed point
3176      representation can be different for the real and imaginary parts.
3177      In this case IS and DS are complex integers.  Additionally the
3178      maximum value of the sum of IS and DS is limited by the
3179      representation of long integers to either 30 or 62.
3180
3181      Called with only two arguments, the fixed point variable that is
3182      created will contain only zeros. A third argument can be used to
3183      give the values of the fixed variables elements. This third
3184      argument F can be either a fixed point variable itself, which
3185      results in a new fixed point variable being created with a
3186      different representation, or a real or complex matrix.
3187
3188 \1f
3189 File: fixed.info,  Node: fixed_inc,  Next: fixed_point_count_operations,  Prev: fixed,  Up: Function Reference
3190
3191 4.0.21 fixed_inc
3192 ----------------
3193
3194  -- Loadable Function: Y = fixed_inc (X)
3195      Example code of the use of the fixed point types in an oct-file.
3196      Returns `X + 1'
3197
3198 \1f
3199 File: fixed.info,  Node: fixed_point_count_operations,  Next: fixed_point_debug,  Prev: fixed_inc,  Up: Function Reference
3200
3201 4.0.22 fixed_point_count_operations
3202 -----------------------------------
3203
3204  -- Loadable Function: VAL = fixed_point_count_operations ()
3205  -- Loadable Function: OLD_VAL = fixed_point_count_operations (NEW_VAL)
3206      Query or set the internal variable `fixed_point_count_operations'.
3207      If enabled, Octave keeps track of how many times each type of
3208      floating point operation has been used internally.  This can be
3209      used to give an approximation of the algorithms complexity.  By
3210      default, this feature is disabled.  See also:
3211      display_fixed_operations
3212
3213 \1f
3214 File: fixed.info,  Node: fixed_point_debug,  Next: fixed_point_library_version,  Prev: fixed_point_count_operations,  Up: Function Reference
3215
3216 4.0.23 fixed_point_debug
3217 ------------------------
3218
3219  -- Loadable Function: VAL = fixed_point_debug ()
3220  -- Loadable Function: OLD_VAL = fixed_point_debug (NEW_VAL)
3221      Query or set the internal variable `fixed_point_debug'.  If
3222      enabled, Octave keeps a copy of the value of fixed point variable
3223      internally. This is useful for use with a debug to allow easy
3224      access to the variables value.  By default this feature is
3225      disabled.
3226
3227 \1f
3228 File: fixed.info,  Node: fixed_point_library_version,  Next: fixed_point_version,  Prev: fixed_point_debug,  Up: Function Reference
3229
3230 4.0.24 fixed_point_library_version
3231 ----------------------------------
3232
3233  -- Loadable Function:  fixed_point_library_version ()
3234      A function returning the version number of the fixed point library
3235      used.
3236
3237 \1f
3238 File: fixed.info,  Node: fixed_point_version,  Next: fixed_point_warn_overflow,  Prev: fixed_point_library_version,  Up: Function Reference
3239
3240 4.0.25 fixed_point_version
3241 --------------------------
3242
3243  -- Loadable Function:  fixed_point_version ()
3244      A function returning the version number of the fixed point package
3245      used.
3246
3247 \1f
3248 File: fixed.info,  Node: fixed_point_warn_overflow,  Next: fixedpoint,  Prev: fixed_point_version,  Up: Function Reference
3249
3250 4.0.26 fixed_point_warn_overflow
3251 --------------------------------
3252
3253  -- Loadable Function: VAL = fixed_point_warn_overflow ()
3254  -- Loadable Function: OLD_VAL = fixed_point_warn_overflow (NEW_VAL)
3255      Query or set the internal variable `fixed_point_warn_overflow'.
3256      If enabled, Octave warns of overflows in fixed point operations.
3257      By default, these warnings are disabled.
3258
3259 \1f
3260 File: fixed.info,  Node: fixedpoint,  Next: float,  Prev: fixed_point_warn_overflow,  Up: Function Reference
3261
3262 4.0.27 fixedpoint
3263 -----------------
3264
3265  -- Function File:  fixedpoint ('help')
3266  -- Function File:  fixedpoint ('info')
3267  -- Function File:  fixedpoint ('info', MOD)
3268  -- Function File:  fixedpoint ('test')
3269  -- Function File:  fixedpoint ('test', MOD)
3270      Manual and test code for the Octave Fixed Point toolbox. There are
3271      5 possible ways to call this function
3272
3273     `fixedpoint ('help')'
3274           Display this help message. Called with no arguments, this
3275           function also displays this help message
3276
3277     `fixedpoint ('info')'
3278           Open the Fixed Point toolbox manual
3279
3280     `fixedpoint ('info', MOD)'
3281           Open the Fixed Point toolbox manual at the section specified
3282           by MOD
3283
3284     `fixedpoint ('test')'
3285           Run all of the test code for the Fixed Point toolbox MOD
3286
3287      Valid values for the varibale MOD are
3288
3289     'basics'
3290           The section describing the use of the fixed point toolbox
3291           within Octave
3292
3293     'programming'
3294           The section descrining how to use the fixed-point type with
3295           oct-files
3296
3297     'example'
3298           The section describing an in-depth example of the use of the
3299           fixed-point type
3300
3301     'reference'
3302           The refernce section of all of the specific fixed point
3303           operators and functions
3304
3305      Please note that this function file should be used as an example
3306      of the use of this toolbox
3307
3308 \1f
3309 File: fixed.info,  Node: float,  Next: flog,  Prev: fixedpoint,  Up: Function Reference
3310
3311 4.0.28 float
3312 ------------
3313
3314  -- Function File: Y = float (X)
3315      Converts a fixed point object to the equivalent floating point
3316      object. This is equivalent to `X.x' if `isfixed(X)' returns true,
3317      and returns X otherwise
3318
3319 \1f
3320 File: fixed.info,  Node: flog,  Next: flog10,  Prev: float,  Up: Function Reference
3321
3322 4.0.29 flog
3323 -----------
3324
3325  -- Loadable Function: Y = flog (X)
3326      Compute the natural logarithm of the fixed point value X.
3327 See also: fexp, flog10, fpow
3328
3329 \1f
3330 File: fixed.info,  Node: flog10,  Next: fprod,  Prev: flog,  Up: Function Reference
3331
3332 4.0.30 flog10
3333 -------------
3334
3335  -- Loadable Function: Y = flog10 (X)
3336      Compute the base-10 logarithm of the fixed point value X.
3337 See also: fexp, flog, fpow
3338
3339 \1f
3340 File: fixed.info,  Node: fprod,  Next: freal,  Prev: flog10,  Up: Function Reference
3341
3342 4.0.31 fprod
3343 ------------
3344
3345  -- Loadable Function: Y = fprod (X,DIM)
3346      Product of elements along dimension DIM.  If DIM is omitted, it
3347      defaults to 1 (column-wise products).
3348 See also: fsum, fsumsq
3349
3350 \1f
3351 File: fixed.info,  Node: freal,  Next: freshape,  Prev: fprod,  Up: Function Reference
3352
3353 4.0.32 freal
3354 ------------
3355
3356  -- Loadable Function: Y = freal (X)
3357      Returns the real part of the fixed point value X.
3358
3359 \1f
3360 File: fixed.info,  Node: freshape,  Next: fround,  Prev: freal,  Up: Function Reference
3361
3362 4.0.33 freshape
3363 ---------------
3364
3365  -- Loadable Function:  freshape (A, M, N)
3366      Return a fixed matrix with M rows and N columns whose elements are
3367      taken from the fixed matrix A.  To decide how to order the
3368      elements, Octave pretends that the elements of a matrix are stored
3369      in column-major order (like Fortran arrays are stored).
3370
3371      For example,
3372
3373           freshape (fixed(3, 2, [1, 2, 3, 4]), 2, 2)
3374           ans =
3375
3376             1.00  3.00
3377             2.00  4.00
3378
3379      If the variable `do_fortran_indexing' is nonzero, the `freshape'
3380      function is equivalent to
3381
3382           retval = fixed(0,0,zeros (m, n));
3383           retval (:) = a;
3384
3385      but it is somewhat less cryptic to use `freshape' instead of the
3386      colon operator.  Note that the total number of elements in the
3387      original matrix must match the total number of elements in the new
3388      matrix.
3389 See also: `:' and do_fortran_indexing
3390
3391 \1f
3392 File: fixed.info,  Node: fround,  Next: fsin,  Prev: freshape,  Up: Function Reference
3393
3394 4.0.34 fround
3395 -------------
3396
3397  -- Loadable Function: Y = fround (X)
3398      Return the rounded value to the nearest integer of X.
3399 See also: ffloor, fceil
3400
3401 \1f
3402 File: fixed.info,  Node: fsin,  Next: fsinh,  Prev: fround,  Up: Function Reference
3403
3404 4.0.35 fsin
3405 -----------
3406
3407  -- Loadable Function: Y = fsin (X)
3408      Compute the sine of the fixed point value X.
3409 See also: fcos, fcosh, fsinh, ftan, ftanh
3410
3411 \1f
3412 File: fixed.info,  Node: fsinh,  Next: fsort,  Prev: fsin,  Up: Function Reference
3413
3414 4.0.36 fsinh
3415 ------------
3416
3417  -- Loadable Function: Y = fsinh (X)
3418      Compute the hyperbolic sine of the fixed point value X.
3419 See also: fcos, fcosh, fsin, ftan, ftanh
3420
3421 \1f
3422 File: fixed.info,  Node: fsort,  Next: fsqrt,  Prev: fsinh,  Up: Function Reference
3423
3424 4.0.37 fsort
3425 ------------
3426
3427  -- Function File: [S, I] = fsort (X)
3428      Return a copy of the fixed point variable X with the elements
3429      arranged in increasing order.  For matrices, `fsort' orders the
3430      elements in each column
3431
3432      For example,
3433
3434           fsort (fixed(4,0,[1, 2; 2, 3; 3, 1]))
3435           =>  1  1
3436           2  2
3437           3  3
3438
3439      The `fsort' function may also be used to produce a matrix
3440      containing the original row indices of the elements in the sorted
3441      matrix.  For example,
3442
3443           [s, i] = sort ([1, 2; 2, 3; 3, 1])
3444           => s = 1  1
3445           2  2
3446           3  3
3447           => i = 1  3
3448           2  1
3449           3  2
3450
3451 \1f
3452 File: fixed.info,  Node: fsqrt,  Next: fsum,  Prev: fsort,  Up: Function Reference
3453
3454 4.0.38 fsqrt
3455 ------------
3456
3457  -- Loadable Function: Y = fsqrt (X)
3458      Compute the square-root of the fixed point value X.
3459
3460 \1f
3461 File: fixed.info,  Node: fsum,  Next: fsumsq,  Prev: fsqrt,  Up: Function Reference
3462
3463 4.0.39 fsum
3464 -----------
3465
3466  -- Loadable Function: Y = fsum (X,DIM)
3467      Sum of elements along dimension DIM.  If DIM is omitted, it
3468      defaults to 1 (column-wise sum).
3469 See also: fprod, fsumsq
3470
3471 \1f
3472 File: fixed.info,  Node: fsumsq,  Next: ftan,  Prev: fsum,  Up: Function Reference
3473
3474 4.0.40 fsumsq
3475 -------------
3476
3477  -- Loadable Function: Y = fsumsq (X,DIM)
3478      Sum of squares of elements along dimension DIM.  If DIM is
3479      omitted, it defaults to 1 (column-wise sum of squares).  This
3480      function is equivalent to computing
3481           fsum (x .* fconj (x), dim)
3482      but it uses less memory and avoids calling `fconj' if X is real.
3483 See also: fprod, fsum
3484
3485 \1f
3486 File: fixed.info,  Node: ftan,  Next: ftanh,  Prev: fsumsq,  Up: Function Reference
3487
3488 4.0.41 ftan
3489 -----------
3490
3491  -- Loadable Function: Y = ftan (X)
3492      Compute the tan of the fixed point value X.
3493 See also: fcos, fcosh, fsinh, ftan, ftanh
3494
3495 \1f
3496 File: fixed.info,  Node: ftanh,  Next: isfixed,  Prev: ftan,  Up: Function Reference
3497
3498 4.0.42 ftanh
3499 ------------
3500
3501  -- Loadable Function: Y = ftanh (X)
3502      Compute the hyperbolic tan of the fixed point value X.
3503 See also: fcos, fcosh, fsin, fsinh, ftan
3504
3505 \1f
3506 File: fixed.info,  Node: isfixed,  Next: lookup_table,  Prev: ftanh,  Up: Function Reference
3507
3508 4.0.43 isfixed
3509 --------------
3510
3511  -- Loadable Function:  isfixed (EXPR)
3512      Return 1 if the value of the expression EXPR is a fixed point
3513      value.
3514
3515 \1f
3516 File: fixed.info,  Node: lookup_table,  Next: reset_fixed_operations,  Prev: isfixed,  Up: Function Reference
3517
3518 4.0.44 lookup_table
3519 -------------------
3520
3521  -- Function File: Y = lookup_table (TABLE, X)
3522  -- Function File: Y = lookup_table (TABLE, X, INTERP, EXTRAP)
3523      Using the lookup table created by "create_lookup_table", find the
3524      value Y corresponding to X. With two arguments the lookup is done
3525      to the nearest value below in the table less than the desired
3526      value. With three arguments a simple linear interpolation is
3527      performed. With four arguments an extrapolation is also performed.
3528      The exact values of arguments three and four are irrelevant, as
3529      only there presence detremines whether interpolation and/or
3530      extrapolation are used
3531
3532 \1f
3533 File: fixed.info,  Node: reset_fixed_operations,  Prev: lookup_table,  Up: Function Reference
3534
3535 4.0.45 reset_fixed_operations
3536 -----------------------------
3537
3538  -- Loadable Function:  reset_fixed_operations ( )
3539      Reset the count of fixed point operations to zero.
3540 See also: fixed_point_count_operations, display_fixed_operations
3541
3542
3543 \1f
3544 Tag Table:
3545 Node: Top\7f0
3546 Node: Basics\7f451
3547 Node: License\7f2189
3548 Node: Representation\7f3637
3549 Node: Creation\7f5758
3550 Node: Overflow\7f10324
3551 Node: Built-in Variables\7f12463
3552 Node: Accessing Internal Fields\7f15016
3553 Node: Function Overloading\7f17290
3554 Node: Together\7f19419
3555 Node: Precision\7f21133
3556 Node: Lookup Tables\7f22801
3557 Node: Known Problems\7f24895
3558 Node: Programming\7f30612
3559 Node: FixedPoint\7f32047
3560 Node: FPConstructors\7f32393
3561 Node: FPSpecific\7f34500
3562 Node: FPOperators\7f38437
3563 Node: FPFunctions\7f42058
3564 Node: FixedPointComplex\7f44635
3565 Node: FPCConstructors\7f45488
3566 Node: FPCSpecific\7f53798
3567 Node: FPCOperators\7f59333
3568 Node: FPCFunctions\7f61802
3569 Node: Derived\7f65276
3570 Node: FixedMatrix\7f67221
3571 Node: FixedRowVector\7f73874
3572 Node: FixedColumnVector\7f80858
3573 Node: FixedComplexMatrix\7f88161
3574 Node: FixedComplexRowVector\7f99293
3575 Node: FixedComplexColumnVector\7f111035
3576 Node: Upper\7f123337
3577 Node: Oct-files\7f125003
3578 Node: Templates\7f125932
3579 Node: Problems\7f127400
3580 Node: Cygwin\7f129334
3581 Node: OctExample\7f130559
3582 Node: Example\7f133601
3583 Node: Function Reference\7f138734
3584 Node: concat\7f142156
3585 Node: create_lookup_table\7f143001
3586 Node: display_fixed_operations\7f143367
3587 Node: fabs\7f143849
3588 Node: fangle\7f144070
3589 Node: farg\7f144239
3590 Node: fatan2\7f144545
3591 Node: fceil\7f144815
3592 Node: fconj\7f145041
3593 Node: fcos\7f145244
3594 Node: fcosh\7f145486
3595 Node: fcumprod\7f145744
3596 Node: fcumsum\7f146066
3597 Node: fdiag\7f146378
3598 Node: fexp\7f147393
3599 Node: ffft\7f147623
3600 Node: ffloor\7f148441
3601 Node: fifft\7f148672
3602 Node: fimag\7f149487
3603 Node: fixed\7f149699
3604 Node: fixed_inc\7f151463
3605 Node: fixed_point_count_operations\7f151745
3606 Node: fixed_point_debug\7f152436
3607 Node: fixed_point_library_version\7f153025
3608 Node: fixed_point_version\7f153370
3609 Node: fixed_point_warn_overflow\7f153699
3610 Node: fixedpoint\7f154205
3611 Node: float\7f155705
3612 Node: flog\7f156025
3613 Node: flog10\7f156266
3614 Node: fprod\7f156511
3615 Node: freal\7f156803
3616 Node: freshape\7f157013
3617 Node: fround\7f158021
3618 Node: fsin\7f158262
3619 Node: fsinh\7f158503
3620 Node: fsort\7f158756
3621 Node: fsqrt\7f159503
3622 Node: fsum\7f159711
3623 Node: fsumsq\7f159991
3624 Node: ftan\7f160450
3625 Node: ftanh\7f160690
3626 Node: isfixed\7f160944
3627 Node: lookup_table\7f161190
3628 Node: reset_fixed_operations\7f161964
3629 \1f
3630 End Tag Table