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
|
scs_ptr is a pointer on a SCS structure.
|
|
Convert a SCS number to a double, rounding to the nearest.
|
|
Convert a SCS number to a double, rounding towards minus infinity.
|
|
Convert a SCS number to a double, rounding towards plus infinity.
|
|
Convert a SCS number to a double, rounding towards zero.
|
|
Convert a double into a SCS number (this is an exact operation).
|
|
Convert an unsigned int into a SCS number (this is an exact operation).
|
|
Print out a SCS number. Sorry for the strange name, we are mimicking GMP |
|
Copy a SCS number into another.
|
|
Set a SCS number to zero.
|
|
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.
|
|
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. |
|
Subtraction of two SCS numbers. The arguments x, y and result may point to the same memory location. The result is a normalised SCS number. |
|
Addition without renormalisation, to be used for adding many numbers.
|
|
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)
|
|
Renormalisation assuming no cancellation. This function is useful for example when adding many numbers of the same sign |
|
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. |
|
Multiplication of a SCS with an unsigned integer; result is returned in x.
|
|
Square. Result is normalised |
|
Fused multiply-and-add (ab+c); Result is normalised.
|
|
SCS inverse. Stores 1/x in result. Result is normalised
|
|
SCS division. Computes x/y. Result is normalised
|
|
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.
|