Loading...
Searching...
No Matches
int64vec Class Reference

`#include <int64vec.h>`

## Public Member Functions

| int64vec (int l=1)
| int64vec (int r, int c, int64 init)
| int64vec (int64vec *iv)
| int64vec (intvec *iv)
int64 & | operator[] (int i)
const int64 & | operator[] (int i) const
void | operator*= (int64 intop)
void | operator/= (int64 intop)
int | compare (const int64vec *o) const
int | length () const
int | cols () const
int | rows () const
void | show (int mat=0, int spaces=0)
char * | String (int dim=2)
char * | iv64String (int not_mat=1, int mat=0, int spaces=0, int dim=2)
int64 * | iv64GetVec ()
| ~int64vec ()
void | iv64TEST ()
Public Member Functions inherited from omallocClass
void * | operator new (size_t size) throw (std::bad_alloc)
void | operator delete (void *block) throw ()
void * | operator new[] (size_t size) throw (std::bad_alloc)
void | operator delete[] (void *block) throw ()
void * | operator new (size_t size, const std::nothrow_t &) throw ()
void * | operator new[] (size_t size, const std::nothrow_t &) throw ()

## Private Attributes

int64 * | v
int | row
int | col

## Detailed Description

Definition at line 20 of file int64vec.h.

## Constructor & Destructor Documentation

## int64vec() [1/4]

int64vec::int64vec | ( | int | l = 1 | ) |

inline

Definition at line 31 of file int64vec.h.

{
v = (int64 *)omAlloc0(sizeof(int64)*l);
row = l;
col = 1;
}
int64
long int64
Definition auxiliary.h:68
l
int l
Definition cfEzgcd.cc:100
int64vec::col
int col
Definition int64vec.h:28
int64vec::v
int64 * v
Definition int64vec.h:26
int64vec::row
int row
Definition int64vec.h:27
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211

## int64vec() [2/4]

int64vec::int64vec | ( | int | r,
|  | int | c,
|  | int64 | init )

Definition at line 41 of file int64vec.cc.

{
row = r;
col = c;
int l = r*c;
if ((r>0) && (c>0))
v = (int64 *)omAlloc(sizeof(int64)*l);
else
v = NULL;
for (int i=0; i<l; i++)
{
v[i] = init;
}
}
i
int i
Definition cfEzgcd.cc:132
LinTree::init
void init()
Definition lintree.cc:864
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210
NULL
#define NULL
Definition omList.c:12

## int64vec() [3/4]

int64vec::int64vec | ( | int64vec * | iv | ) |

Definition at line 19 of file int64vec.cc.

{
row = iv->rows();
col = iv->cols();
v = (int64 *)omAlloc(sizeof(int64)*row*col);
for (int i=0; i<row*col; i++)
{
v[i] = (*iv)[i];
}
}
int64vec::rows
int rows() const
Definition int64vec.h:66
int64vec::cols
int cols() const
Definition int64vec.h:65

## int64vec() [4/4]

int64vec::int64vec | ( | intvec * | iv | ) |

Definition at line 30 of file int64vec.cc.

{
row = iv->rows();
col = iv->cols();
v = (int64 *)omAlloc(sizeof(int64)*row*col);
for (int i=0; i<row*col; i++)
{
v[i] = (int64)((*iv)[i]);
}
}
intvec::cols
int cols() const
Definition intvec.h:96
intvec::rows
int rows() const
Definition intvec.h:97

## ~int64vec()

int64vec::~int64vec | ( |  | ) |

inline

Definition at line 71 of file int64vec.h.

{
if (v!=NULL)
{
omFreeSize((ADDRESS)v,sizeof(int64)*row*col);
v=NULL;
}
}
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260

## Member Function Documentation

## cols()

int int64vec::cols | ( |  | ) | const

inline

Definition at line 65 of file int64vec.h.

{ return col; }

## compare()

int int64vec::compare | ( | const int64vec * | o | ) | const

Definition at line 138 of file int64vec.cc.

{
if ((col!=1) ||(op->cols()!=1))
{
if((col!=op->cols())
|| (row!=op->rows()))
return -2;
}
int i;
for (i=0; i<si_min(length(),op->length()); i++)
{
if (v[i] > (*op)[i])
return 1;
if (v[i] < (*op)[i])
return -1;
}
// this can only happen for int64vec: (i.e. col==1)
for (; i<row; i++)
{
if (v[i] > 0)
return 1;
if (v[i] < 0)
return -1;
}
for (; i<op->rows(); i++)
{
if (0 > (*op)[i])
return 1;
if (0 < (*op)[i])
return -1;
}
return 0;
}
si_min
static int si_min(const int a, const int b)
Definition auxiliary.h:126
int64vec::length
int length() const
Definition int64vec.h:64

## iv64GetVec()

int64 * int64vec::iv64GetVec | ( |  | ) |

inline

Definition at line 70 of file int64vec.h.

{ return v; }

## iv64String()

char * int64vec::iv64String | ( | int | not_mat = 1,
|  | int | mat = 0,
|  | int | spaces = 0,
|  | int | dim = 2 )

Definition at line 56 of file int64vec.cc.

{
StringSetS("");
if ((col == 1)&&(not_mat))
{
int i=0;
for (; i<row-1; i++)
{
StringAppend("%lld,",v[i]);
}
if (i<row)
{
StringAppend("%lld",v[i]);
}
}
else
{
for (int j=0; j<row; j++)
{
if (j<row-1)
{
for (int i=0; i<col; i++)
{
StringAppend("%lld%c",v[j*col+i],',');
}
}
else
{
for (int i=0; i<col; i++)
{
StringAppend("%lld%c",v[j*col+i],i<col-1 ? ',' : ' ');
}
}
if (j+1<row)
{
if (dim > 1) StringAppendS("\n");
if (spaces>0) StringAppend("%-*.*s",spaces,spaces," ");
}
}
}
return StringEndS();
}
StringAppend
#define StringAppend
Definition emacs.cc:79
j
int j
Definition facHensel.cc:110
StringSetS
void StringSetS(const char *st)
Definition reporter.cc:128
StringAppendS
void StringAppendS(const char *st)
Definition reporter.cc:107
StringEndS
char * StringEndS()
Definition reporter.cc:151
dim
int dim(ideal I, ring r)
Definition tropicalStrategy.cc:23

## iv64TEST()

void int64vec::iv64TEST | ( |  | ) |

inline

Definition at line 79 of file int64vec.h.

{
omCheckAddrSize((ADDRESS)v,sizeof(int64)*row*col);
}
omCheckAddrSize
#define omCheckAddrSize(addr, size)
Definition omAllocDecl.h:327

## length()

int int64vec::length | ( |  | ) | const

inline

Definition at line 64 of file int64vec.h.

{ return col*row; }

## operator*=()

void int64vec::operator*= | ( | int64 | intop | ) |

Definition at line 119 of file int64vec.cc.

{
for (int i=row*col-1; i>=0; i--) { v[i] *= intop; }
}

## operator/=()

void int64vec::operator/= | ( | int64 | intop | ) |

Definition at line 124 of file int64vec.cc.

{
if (intop == 0) return;
int64 bb=ABS(intop);
for (int i=row*col-1; i>=0; i--)
{
int64 r=v[i];
int64 c=r%bb;
if (c<0) c+=bb;
r=(r-c)/intop;
v[i]=r;
}
}
ABS
static int ABS(int v)
Definition auxiliary.h:113

## operator[]() [1/2]

int64 & int64vec::operator[] | ( | int | i | ) |

inline

Definition at line 40 of file int64vec.h.

{
#ifndef SING_NDEBUG
if((i<0)||(i>=row*col))
{
Werror("wrong int64vec index:%d\n",i);
}
#endif
return v[i];
}
Werror
void Werror(const char *fmt,...)
Definition reporter.cc:189

## operator[]() [2/2]

const int64 & int64vec::operator[] | ( | int | i | ) | const

inline

Definition at line 50 of file int64vec.h.

{
#ifndef SING_NDEBUG
if((i<0)||(i>=row*col))
{
Werror("wrong int64vec index:%d\n",i);
}
#endif
return v[i];
}

## rows()

int int64vec::rows | ( |  | ) | const

inline

Definition at line 66 of file int64vec.h.

{ return row; }

## show()

void int64vec::show | ( | int | mat = 0,
|  | int | spaces = 0 )

Definition at line 104 of file int64vec.cc.

{
char *s=iv64String(notmat,spaces);
if (spaces>0)
{
PrintNSpaces(spaces);
PrintS(s);
}
else
{
PrintS(s);
}
omFree(s);
}
int64vec::iv64String
char * iv64String(int not_mat=1, int mat=0, int spaces=0, int dim=2)
Definition int64vec.cc:56
s
const CanonicalForm int s
Definition facAbsFact.cc:51
omFree
#define omFree(addr)
Definition omAllocDecl.h:261
PrintNSpaces
void PrintNSpaces(const int n)
Definition reporter.cc:368
PrintS
void PrintS(const char *s)
Definition reporter.cc:288

## String()

char * int64vec::String | ( | int | dim = 2 | ) |

Definition at line 99 of file int64vec.cc.

{
return iv64String(0, 0, dim);
}

## Field Documentation

## col

int int64vec::col

private

Definition at line 28 of file int64vec.h.

## row

int int64vec::row

private

Definition at line 27 of file int64vec.h.

## v

int64* int64vec::v

private

Definition at line 26 of file int64vec.h.

The documentation for this class was generated from the following files:

- libpolys/misc/int64vec.h
- libpolys/misc/int64vec.cc