Loading...
Searching...
No Matches
int64vec.h File Reference
`#include <string.h>`
`#include "misc/auxiliary.h"`
`#include "omalloc/omalloc.h"`
`#include "omalloc/omallocClass.h"`
`#include "misc/intvec.h"`

Go to the source code of this file.

## Data Structures

class | int64vec

## Macros

#define | iv64Test(v)

## Functions

int64vec * | iv64Copy (int64vec *o)
int64vec * | iv64Add (int64vec *a, int64vec *b)
int64vec * | iv64Sub (int64vec *a, int64vec *b)

## Macro Definition Documentation

## iv64Test

#define iv64Test | ( |  | v | ) |

Value:
do {} while (0)

Definition at line 96 of file int64vec.h.

## Function Documentation

## iv64Add()

int64vec * iv64Add | ( | int64vec * | a,
|  | int64vec * | b )

Definition at line 172 of file int64vec.cc.

{
int64vec * iv;
int64 mn, ma, i;
if (a->cols() != b->cols()) return NULL;
mn = si_min(a->rows(),b->rows());
ma = si_max(a->rows(),b->rows());
if (a->cols() == 1)
{
iv = new int64vec(ma);
for (i=0; i<mn; i++) (*iv)[i] = (*a)[i] + (*b)[i];
if (ma > mn)
{
if (ma == a->rows())
{
for(i=mn; i<ma; i++) (*iv)[i] = (*a)[i];
}
else
{
for(i=mn; i<ma; i++) (*iv)[i] = (*b)[i];
}
}
return iv;
}
if (mn != ma) return NULL;
iv = new int64vec(a);
for (i=0; i<mn*a->cols(); i++) { (*iv)[i] += (*b)[i]; }
return iv;
}
int64
long int64
Definition auxiliary.h:68
si_max
static int si_max(const int a, const int b)
Definition auxiliary.h:125
si_min
static int si_min(const int a, const int b)
Definition auxiliary.h:126
i
int i
Definition cfEzgcd.cc:132
b
CanonicalForm b
Definition cfModGcd.cc:4111
int64vec
Definition int64vec.h:24
int64vec::rows
int rows() const
Definition int64vec.h:66
int64vec::cols
int cols() const
Definition int64vec.h:65
NULL
#define NULL
Definition omList.c:12

## iv64Copy()

int64vec * iv64Copy | ( | int64vec * | o | ) |

inline

Definition at line 84 of file int64vec.h.

{
int64vec * iv=new int64vec(o);
return iv;
}

## iv64Sub()

int64vec * iv64Sub | ( | int64vec * | a,
|  | int64vec * | b )

Definition at line 202 of file int64vec.cc.

{
int64vec * iv;
int mn, ma,i;
if (a->cols() != b->cols()) return NULL;
mn = si_min(a->rows(),b->rows());
ma = si_max(a->rows(),b->rows());
if (a->cols() == 1)
{
iv = new int64vec(ma);
for (i=0; i<mn; i++) (*iv)[i] = (*a)[i] - (*b)[i];
if (ma > mn)
{
if (ma == a->rows())
{
for(i=mn; i<ma; i++) (*iv)[i] = (*a)[i];
}
else
{
for(i=mn; i<ma; i++) (*iv)[i] = -(*b)[i];
}
}
return iv;
}
if (mn != ma) return NULL;
iv = new int64vec(a);
for (i=0; i<mn*a->cols(); i++) { (*iv)[i] -= (*b)[i]; }
return iv;
}