79 v = (number *)
omAlloc(
sizeof(number)*
l);
82 for (
int i = l - 1;
i>=0;
i--)
92 const int l = row*
col;
101 v = (number *)
omAlloc(
sizeof(number)*row*
col);
105 for (
int i = l-1;
i>=0;
i--)
115 if((i<0)||(i>=row*col))
117 Werror(
"wrong bigintmat index:%d\n",i);
119 assume ( !((i<0)||(i>=row*col)) );
126 if((i<0)||(i>=row*col))
128 Werror(
"wrong bigintmat index:%d\n",i);
130 assume ( !((i<0)||(i>=row*col)) );
134 #define BIMATELEM(M,I,J) (M)[(I-1)*(M).cols()+J-1] 169 const int index = ((r-1)*
cols() + (c-1));
176 number
get(
int i,
int j)
const;
179 number
view(
int i,
int j)
const;
182 number
get(
int i)
const;
184 number
view(
int i)
const;
188 void set(
int i,
int j, number n,
const coeffs C =
NULL);
211 Werror(
"wrong bigintmat index:%d\n",i);
246 void swap(
int i,
int j);
280 void coltransform(
int i,
int j, number a, number b, number c, number d);
void operator*=(int intop)
UEberladener *=-Operator (fuer int und bigint) Frage hier: *= verwenden oder lieber = und * einzeln...
void concatcol(bigintmat *a, bigintmat *b)
void skaldiv(number b)
Macht Ganzzahldivision aller Matrixeinträge mit b.
void splitcol(bigintmat *a, bigintmat *b)
... linken ... rechten ...
const CanonicalForm int s
void concatrow(bigintmat *a, bigintmat *b)
Fügt zwei Matrixen untereinander/nebeneinander in gegebene Matrix ein, bzw spaltet gegebenen Matrix ...
void swaprow(int i, int j)
swap rows i and j
number det()
det (via LaPlace in general, hnf for euc. rings)
bool addcol(int i, int j, number a, coeffs c)
addiert a-faches der j-ten Spalte zur i-ten dazu
void colskaldiv(int j, number b)
Macht Ganzzahldivision aller j-ten Spalteneinträge mit b.
void getrow(int i, bigintmat *a)
Schreibt i-te Zeile in Vektor (Matrix) a.
bool operator!=(const bigintmat &lhr, const bigintmat &rhr)
void simplifyContentDen(number *den)
ensures that Gcd(den, content)=1 enden hier wieder
void inpTranspose()
transpose in place
void setcol(int j, bigintmat *m)
Setzt j-te Spalte gleich übergebenem Vektor (Matrix) m.
void appendCol(bigintmat *a)
horizontally join the matrices, m <- m|a
bool sub(bigintmat *b)
Subtrahiert ...
int isOne()
is matrix is identity
void rowskalmult(int i, number a, coeffs c)
... Zeile ...
bigintmat(int r, int c, const coeffs n)
constructor: the r times c zero-matrix. Beware that the creation of a large zero matrix is expensive ...
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
#define omFreeSize(addr, size)
number solveAx(bigintmat *A, bigintmat *b, bigintmat *x)
solve Ax=b*d. x needs to be pre-allocated to the same number of columns as b. the minimal denominator...
bigintmat * bimChangeCoeff(bigintmat *a, coeffs cnew)
Liefert Kopier von Matrix a zurück, mit coeffs cnew statt den ursprünglichen.
void zero()
Setzt alle Einträge auf 0.
int findnonzero(int i)
find index of 1st non-zero entry in row i
char * StringAsPrinted()
Returns a string as it would have been printed in the interpreter.
void getColRange(int j, int no, bigintmat *a)
copies the no-columns staring by j (so j...j+no-1) into the pre-allocated a
void setrow(int i, bigintmat *m)
Setzt i-te Zeile gleich übergebenem Vektor (Matrix) m.
int findcolnonzero(int j)
find index of 1st non-zero entry in column j
number & operator[](int i)
dubious: 1-dim access to 2-dim array. Entries are read row by row.
bigintmat * iv2bim(intvec *b, const coeffs C)
void Write()
IO: writes the matrix into the current internal string buffer which must be started/ allocated before...
bigintmat * bimCopy(const bigintmat *b)
same as copy constructor - apart from it being able to accept NULL as input
void rawset(int i, number n, const coeffs C=NULL)
replace an entry with the given number n (only delete old). NOTE: starts at [0]. Should be named set_...
const number & operator[](int i) const
~bigintmat()
canonical destructor.
Coefficient rings, fields and other domains suitable for Singular polynomials.
bigintmat * bimAdd(bigintmat *a, bigintmat *b)
Matrix-Add/-Sub/-Mult so oder mit operator+/-/* ? : NULL as a result means an error (non-compatible m...
void copySubmatInto(bigintmat *, int sr, int sc, int nr, int nc, int tr, int tc)
copy the submatrix of b, staring at (a,b) having n rows, m cols into the given matrix at pos...
bool addrow(int i, int j, number a, coeffs c)
... Zeile ...
void extendCols(int i)
append i zero-columns to the matrix
void swapMatrix(bigintmat *a)
The main handler for Singular numbers which are suitable for Singular polynomials.
bool skalmult(number b, coeffs c)
Multipliziert zur Matrix den Skalar b hinzu.
void swap(int i, int j)
swap columns i and j
int index(int r, int c) const
helper function to map from 2-dim coordinates, starting by 1 to 1-dim coordinate, starting by 0 ...
number view(int i, int j) const
view an entry an entry. NOTE: starts at [1,1]
bigintmat * bimMult(bigintmat *a, bigintmat *b)
void hnf()
transforms INPLACE to HNF
bigintmat * bimSub(bigintmat *a, bigintmat *b)
void rawset(int i, int j, number n, const coeffs C=NULL)
as above, but the 2-dim version
bigintmat * modgauss(number p, coeffs c)
void Print()
IO: simply prints the matrix to the current output (screen?)
number content()
the content, the gcd of all entries. Only makes sense for Euclidean rings (or possibly constructive P...
void getcol(int j, bigintmat *a)
copies the j-th column into the matrix a - which needs to be pre-allocated with the correct size...
bigintmat(const bigintmat *m)
copy constructor
bigintmat * modhnf(number p, coeffs c)
computes HNF(this | p*I)
number trace()
the trace ....
void colskalmult(int i, number a, coeffs c)
Multipliziert zur i-ten Spalte den Skalar a hinzu.
void diagonalForm(bigintmat *a, bigintmat **b, bigintmat **c)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
coeffs basecoeffs() const
int kernbase(bigintmat *a, bigintmat *c, number p, coeffs q)
a basis for the nullspace of a mod p: only used internally in Round2. Don't use it.
char * String()
IO: String returns a singular string containing the matrix, needs freeing afterwards.
bool operator==(const bigintmat &lhr, const bigintmat &rhr)
bool copy(bigintmat *b)
Kopiert Einträge von b auf Bigintmat.
void inpMult(number bintop, const coeffs C=NULL)
inplace version of skalar mult. CHANGES input.
bool nCoeffs_are_equal(coeffs r, coeffs s)
number hnfdet()
det via HNF Primzahlen als long long int, müssen noch in number umgewandelt werden?
bigintmat * elim(int i, int j)
Liefert Streichungsmatrix (i-te Zeile und j-te Spalte gestrichen) zurück.
void coltransform(int i, int j, number a, number b, number c, number d)
transforms cols (i,j) using the 2x2 matrix ((a,b)(c,d)) (hopefully)
bigintmat * inpmod(number p, coeffs c)
Liefert Kopie der Matrix zurück, allerdings im Ring Z modulo p.
void splitrow(bigintmat *a, bigintmat *b)
Speichert in Matrix a den oberen, in b den unteren Teil der Matrix, vorausgesetzt die Dimensionen sti...
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
number pseudoinv(bigintmat *a)
Speichert in Matrix a die Pseudoinverse, liefert den Nenner zurück.
int compare(const bigintmat *op) const
intvec * bim2iv(bigintmat *b)
void howell()
dito, but Howell form (only different for zero-divsors)
bool add(bigintmat *b)
Addiert zur Matrix die Matrix b dazu. Return false => an error occurred.
void Werror(const char *fmt,...)
void one()
Macht Matrix (Falls quadratisch) zu Einheitsmatrix.
void mod(number p)
Reduziert komplette Matrix modulo p.