#include <string.h>
#include <omalloc/omallocClass.h>
#include <reporter/reporter.h>
Go to the source code of this file.
◆ IMATELEM
#define IMATELEM |
( |
|
M, |
|
|
|
I, |
|
|
|
J |
|
) |
| (M)[(I-1)*(M).cols()+J-1] |
◆ ivTest
◆ ivAdd()
Definition at line 250 of file intvec.cc.
254 if (
a->cols() !=
b->cols())
return NULL;
260 for (
i=0;
i<mn;
i++) (*iv)[
i] = (*a)[
i] + (*b)[
i];
265 for(
i=mn;
i<ma;
i++) (*iv)[
i] = (*a)[
i];
269 for(
i=mn;
i<ma;
i++) (*iv)[
i] = (*b)[
i];
274 if (mn != ma)
return NULL;
276 for (
i=0;
i<mn*
a->cols();
i++) { (*iv)[
i] += (*b)[
i]; }
static int si_min(const int a, const int b)
static int si_max(const int a, const int b)
◆ ivConcat()
Definition at line 805 of file intvec.cc.
808 int c = ac +
b->cols();
int r =
si_max(
a->rows(),
b->rows());
812 for (
i=1;
i<=
a->rows();
i++)
817 for (
i=1;
i<=
b->rows();
i++)
819 for(
j=1;
j<=
b->cols();
j++)
static int si_max(const int a, const int b)
#define IMATELEM(M, I, J)
◆ ivCopy()
◆ ivMult()
Definition at line 332 of file intvec.cc.
335 ra =
a->rows(), ca =
a->cols(),
336 rb =
b->rows(), cb =
b->cols();
338 if (ca != rb)
return NULL;
339 iv =
new intvec(ra, cb, 0);
346 sum += (*
a)[
i*ca+
k]*(*b)[
k*cb+
j];
◆ ivSolveKern()
Definition at line 425 of file intvec.cc.
436 for (
r=1;
r<=dimtr;
r++)
443 for (
r=dimtr;
r>0;
r--)
static intvec * ivOptimizeKern(intvec *)
intvec * ivTranp(intvec *o)
static void ivKernFromRow(intvec *, intvec *, intvec *, int, int, int)
#define IMATELEM(M, I, J)
◆ ivSub()
Definition at line 280 of file intvec.cc.
284 if (
a->cols() !=
b->cols())
return NULL;
290 for (
i=0;
i<mn;
i++) (*iv)[
i] = (*a)[
i] - (*b)[
i];
295 for(
i=mn;
i<ma;
i++) (*iv)[
i] = (*a)[
i];
299 for(
i=mn;
i<ma;
i++) (*iv)[
i] = -(*b)[
i];
304 if (mn != ma)
return NULL;
306 for (
i=0;
i<mn*
a->cols();
i++) { (*iv)[
i] -= (*b)[
i]; }
static int si_min(const int a, const int b)
static int si_max(const int a, const int b)
◆ ivTrace()
Definition at line 322 of file intvec.cc.
const CanonicalForm int s
static int si_min(const int a, const int b)
◆ ivTranp()
◆ ivTriangIntern()
void ivTriangIntern |
( |
intvec * |
imat, |
|
|
int & |
ready, |
|
|
int & |
all |
|
) |
| |
Definition at line 387 of file intvec.cc.
389 int rpiv, colpos=0, rowpos=0;
390 int ia=ready, ie=all;
398 rpiv =
ivColPivot(imat, colpos, rowpos, ia, ie);
410 if (ia==imat->
cols())
417 ivReduce(imat, rpiv, colpos, ia, ie);
static void ivZeroElim(intvec *, int, int, int &)
static void ivFreeRow(intvec *, int, int)
static void ivSaveRow(intvec *, int)
static int ivColPivot(intvec *, int, int, int, int)
static void ivReduce(intvec *, int, int, int, int)
static void ivSetRow(intvec *, int, int)