Go to the source code of this file.
Functions | |
void | scs_set (scs_ptr result, scs_ptr x) |
void | scs_renorm (scs_ptr result) |
void | scs_renorm_no_cancel_check (scs_ptr result) |
void | scs_add_no_renorm (scs_ptr result, scs_ptr x, scs_ptr y) |
void | scs_add (scs_ptr result, scs_ptr x, scs_ptr y) |
void | scs_sub (scs_ptr result, scs_ptr x, scs_ptr y) |
Many functions come in two versions, selected by a #if.
The reason is that we designed scslib library for internal use with SCS_NB_WORDS==8, so we provide a version with manual optimizations for this case.
These optimisations include loop unrolling, and sometimes replacing temporary arrays of size 8 with 8 variables, which is more efficient on all modern processors with many (renaming) registers.
Using gcc3.2 with the most aggressive optimization options for this purpose (-funroll-loops -foptimize-register-move -frerun-loop-opt -frerun-cse-after-loop) is still much slower. At some point in the future, gcc should catch up with unrolling since our loops are so simple, however the replacement of small arrays with variables is not something we are aware of in the literature about compiler optimization.
Definition in file addition_scs.c.
|
Copy a SCS number into another. There is an unrolled version for the case SCS_NB_WORDS==8. Definition at line 55 of file addition_scs.c. |
|
Renormalisation (to be used after several scs_add_no_renorm). This function removes the carry from each digit, and also shifts the digits in case of a cancellation (so that if result != 0 then its first digit is non-zero)
Definition at line 84 of file addition_scs.c. |
|
Renormalisation assuming no cancellation. This renormalization step is especially designed for the addition of several numbers with the same sign. In this case, you know that there has been no cancellation, which allows simpler renormalisation. Definition at line 137 of file addition_scs.c. |
|
Addition without renormalisation, to be used for adding many numbers.
Definition at line 224 of file addition_scs.c. |
|
Addition of two SCS numbers. The arguments x, y and result may point to the same memory location. The result is a normalised SCS number. Definition at line 514 of file addition_scs.c. References scs::exception, and scs_set(). |
|
Subtraction of two SCS numbers. The arguments x, y and result may point to the same memory location. Definition at line 539 of file addition_scs.c. References scs::exception, and scs_set(). Referenced by scs_inv(). |