Go to the source code of this file.
Data Structures | |
struct | scs |
The SCS data type. More... | |
SCS data-types | |
typedef scs * | scs_ptr |
scs | scs_t [1] |
Conversion and initialization functions | |
void | scs_get_d (double *, scs_ptr) |
void | scs_get_d_minf (double *, scs_ptr) |
void | scs_get_d_pinf (double *, scs_ptr) |
void | scs_get_d_zero (double *, scs_ptr) |
void | scs_set_d (scs_ptr, double) |
void | scs_set_si (scs_ptr, signed int) |
void | scs_get_std (scs_ptr) |
void | scs_set (scs_ptr, scs_ptr) |
void | scs_zero (scs_ptr) |
void | scs_rand (scs_ptr result, int expo_max) |
Addition and renormalisation functions | |
void | scs_add (scs_ptr result, scs_ptr x, scs_ptr y) |
void | scs_sub (scs_ptr result, scs_ptr x, scs_ptr y) |
void | scs_add_no_renorm (scs_ptr result, scs_ptr x, scs_ptr y) |
void | scs_renorm (scs_ptr) |
void | scs_renorm_no_cancel_check (scs_ptr) |
Multiplication functions | |
void | scs_mul (scs_ptr result, const scs_ptr x, const scs_ptr y) |
void | scs_mul_ui (scs_ptr, const unsigned int) |
void | scs_square (scs_ptr result, scs_ptr x) |
void | scs_fma (scs_ptr result, scs_ptr a, scs_ptr b, scs_ptr c) |
Divisions | |
void | scs_inv (scs_ptr result, scs_ptr x) |
void | scs_div (scs_ptr result, scs_ptr x, scs_ptr y) |
Copyright (C) 2002 David Defour and Florent de Dinechin
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Definition in file scs.h.
|
scs_ptr is a pointer on a SCS structure.
|
|
Convert a SCS number to a double, rounding to the nearest.
Definition at line 50 of file scs2double.c. |
|
Convert a SCS number to a double, rounding towards minus infinity.
Definition at line 366 of file scs2double.c. References scs_get_d_minf(). Referenced by scs_get_d_minf(). |
|
Convert a SCS number to a double, rounding towards plus infinity.
Definition at line 377 of file scs2double.c. References scs_get_d_pinf(). Referenced by scs_get_d_pinf(). |
|
Convert a SCS number to a double, rounding towards zero.
Definition at line 388 of file scs2double.c. References scs_get_d_zero(). Referenced by scs_get_d_zero(). |
|
Convert a double into a SCS number (this is an exact operation).
Definition at line 36 of file double2scs.c. Referenced by scs_inv(). |
|
Convert an unsigned int into a SCS number (this is an exact operation).
Definition at line 148 of file double2scs.c. Referenced by scs_inv(). |
|
Print out a SCS number. Sorry for the strange name, we are mimicking GMP Definition at line 59 of file print_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. |
|
Set a SCS number to zero. There should be a few simple functions in this library. Definition at line 40 of file zero_scs.c. |
|
Generate a random SCS number. The index field of result will be between -expo_max and +expo_max. Example: to get a number in the double-precision floating-point range, expo_max should be smaller than 39.
Definition at line 51 of file rand_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(). |
|
Addition without renormalisation, to be used for adding many numbers.
Definition at line 224 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. |
|
Multiplication 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 291 of file multiplication_scs.c. |
|
Multiplication of a SCS with an unsigned integer; result is returned in x.
Definition at line 448 of file multiplication_scs.c. |
|
Square. Result is normalised Definition at line 378 of file multiplication_scs.c. |
|
Fused multiply-and-add (ab+c); Result is normalised.
Definition at line 27 of file poly_fct.c. |
|
SCS inverse. Stores 1/x in result. Result is normalised
Definition at line 38 of file division_scs.c. References scs::index, scs_get_d(), scs_mul(), scs_set(), scs_set_d(), scs_set_si(), scs_sub(), and scs_t. Referenced by scs_div(). |
|
SCS division. Computes x/y. Result is normalised
Definition at line 67 of file division_scs.c. |
|
scs_t is an array of one SCS struct to lighten syntax : you may declare a scs_t object, and pass it to the scs functions (which expect pointers) without using ampersands.
|