![]() |
This file provides miscellaneous functionality. More...
#include <kernel/mod2.h>
#include <misc/auxiliary.h>
#include <misc/sirandom.h>
#include <reporter/si_signals.h>
#include <factory/factory.h>
#include <coeffs/si_gmp.h>
#include <coeffs/coeffs.h>
#include <coeffs/OPAE.h>
#include <coeffs/OPAEQ.h>
#include <coeffs/OPAEp.h>
#include <polys/ext_fields/algext.h>
#include <polys/ext_fields/transext.h>
#include <polys/nc/gb_hack.h>
#include <Singular/links/simpleipc.h>
#include "misc_ip.h"
#include "ipid.h"
#include "feOpt.h"
#include "links/silink.h"
#include "mod_lib.h"
#include <omalloc/omalloc.h>
#include <misc/mylimits.h>
#include <misc/options.h>
#include <misc/intvec.h>
#include <polys/monomials/ring.h>
#include <polys/templates/p_Procs.h>
#include <kernel/GBEngine/kstd1.h>
#include <kernel/oswrapper/timer.h>
#include <resources/feResource.h>
#include <kernel/oswrapper/feread.h>
#include "subexpr.h"
#include "cntrlc.h"
#include "ipshell.h"
#include "fehelp.h"
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <time.h>
#include <flint/flint.h>
#include <NTL/version.h>
#include <sys/types.h>
#include <sys/stat.h>
Go to the source code of this file.
Data Structures | |
struct | soptionStruct |
Macros | |
#define | PLURAL_INTERNAL_DECLARATIONS 1 |
#define | SI_SHOW_BUILTIN_MODULE(name) StringAppend(" %s", #name); |
Functions | |
static FORCE_INLINE void | number2mpz (number n, mpz_t m) |
static FORCE_INLINE number | mpz2number (mpz_t m) |
void | setListEntry (lists L, int index, mpz_t n) |
void | setListEntry_ui (lists L, int index, unsigned long ui) |
static int | factor_using_division (mpz_t t, unsigned int limit, lists primes, int *multiplicities, int &index, unsigned long bound) |
static void | factor_using_pollard_rho (mpz_t n, unsigned long a, lists primes, int *multiplicities, int &index) |
static void | factor_gmp (mpz_t t, lists primes, int *multiplicities, int &index, unsigned long bound) |
lists | primeFactorisation (const number n, const int pBound) |
Factorises a given bigint number n into its prime factors less than or equal to a given bound, with corresponding multiplicities. More... | |
void | singular_example (char *str) |
BOOLEAN | setOption (leftv res, leftv v) |
char * | showOption () |
char * | versionString () |
void | checkall () |
int | singular_fstat (int fd, struct stat *buf) |
void | m2_end (int i) |
void | omSingOutOfMemoryFunc () |
static BOOLEAN | ii_pAE_init (leftv res, leftv a) |
void | siInit (char *name) |
Variables | |
static unsigned | add [] = {4, 2, 4, 2, 4, 6, 2, 6} |
struct soptionStruct | optionStruct [] |
struct soptionStruct | verboseStruct [] |
volatile BOOLEAN | m2_end_called = FALSE |
const char * | singular_date =__DATE__ " " __TIME__ |
static n_coeffType | n_pAE =n_unknown |
This file provides miscellaneous functionality.
For more general information, see the documentation in misc_ip.h.
Definition in file misc_ip.cc.
struct soptionStruct |
#define PLURAL_INTERNAL_DECLARATIONS 1 |
Definition at line 14 of file misc_ip.cc.
#define SI_SHOW_BUILTIN_MODULE | ( | name | ) | StringAppend(" %s", #name); |
void checkall | ( | ) |
Definition at line 1016 of file misc_ip.cc.
|
static |
Definition at line 301 of file misc_ip.cc.
|
static |
Definition at line 83 of file misc_ip.cc.
|
static |
Definition at line 178 of file misc_ip.cc.
Definition at line 1179 of file misc_ip.cc.
void m2_end | ( | int | i | ) |
Definition at line 1074 of file misc_ip.cc.
|
static |
Definition at line 45 of file misc_ip.cc.
|
static |
Definition at line 44 of file misc_ip.cc.
void omSingOutOfMemoryFunc | ( | ) |
Definition at line 1167 of file misc_ip.cc.
Factorises a given bigint number n into its prime factors less than or equal to a given bound, with corresponding multiplicities.
The method finds all prime factors with multiplicities. If a positive bound is given, then only the prime factors <= pBound are being found. In this case, there may remain an unfactored portion m of n. Also, when n is negative, m will contain the sign. If n is zero, m will be zero. The method returns a list L filled with three entries: L[1] a list; L[1][i] contains the i-th prime factor of |n| as int or bigint (sorted in ascending order), L[2] a list; L[2][i] contains the multiplicity of L[1, i] in |n| as int L[3] contains the remainder m as int or bigint, depending on the size,
We thus have: n = L[1][1]^L[2][1] * ... * L[1][k]^L[2][k] * L[3], where k is the number of mutually distinct prime factors (<= a provided non- zero bound). Note that for n = 0, L[1] and L[2] will be emtpy lists and L[3] will be zero.
[in] | n | the bigint > 0 to be factorised |
[in] | pBound | bound on the prime factors seeked |
Definition at line 331 of file misc_ip.cc.
: TRUE iff (n != 0 and (LC(n) > 0 or deg(n) > 0)) in K(t_1, ..., t_n): TRUE iff (LC(numerator(n) is a constant and > 0) or (LC(numerator(n) is not a constant) in Z/2^kZ: TRUE iff 0 < n <= 2^(k-1) in Z/mZ: TRUE iff the internal mpz is greater than zero in Z: TRUE iff n > 0
void setListEntry | ( | lists | L, |
int | index, | ||
mpz_t | n | ||
) |
Definition at line 48 of file misc_ip.cc.
void setListEntry_ui | ( | lists | L, |
int | index, | ||
unsigned long | ui | ||
) |
Definition at line 65 of file misc_ip.cc.
Definition at line 580 of file misc_ip.cc.
char* showOption | ( | ) |
Definition at line 726 of file misc_ip.cc.
void siInit | ( | char * | name | ) |
Definition at line 1197 of file misc_ip.cc.
void singular_example | ( | char * | str | ) |
Definition at line 437 of file misc_ip.cc.
int singular_fstat | ( | int | fd, |
struct stat * | buf | ||
) |
Definition at line 1059 of file misc_ip.cc.
char* versionString | ( | ) |
Definition at line 783 of file misc_ip.cc.
|
static |
Definition at line 81 of file misc_ip.cc.
Definition at line 1072 of file misc_ip.cc.
|
static |
Definition at line 1178 of file misc_ip.cc.
struct soptionStruct optionStruct[] |
Definition at line 521 of file misc_ip.cc.
const char* singular_date =__DATE__ " " __TIME__ |
Definition at line 1163 of file misc_ip.cc.
struct soptionStruct verboseStruct[] |
Definition at line 551 of file misc_ip.cc.