My Project  UNKNOWN_GIT_VERSION
int64vec.h
Go to the documentation of this file.
1 #ifndef INT64VEC_H
2 #define INT64VEC_H
3 /****************************************
4 * Computer Algebra System SINGULAR *
5 ****************************************/
6 /*
7 * ABSTRACT: class intvec: lists/vectors of int64
8 */
9 #include <string.h>
10 #include "misc/auxiliary.h"
11 #include "omalloc/omalloc.h"
12 #ifndef XMEMORY_H
13 #include "omalloc/omallocClass.h"
14 #endif
15 #include "misc/intvec.h"
16 
17 class int64vec
18 #ifndef XMEMORY_H
19  :public omallocClass
20 #endif
21 {
22 private:
23  int64 *v;
24  int row;
25  int col;
26 public:
27 
28  int64vec(int l = 1)
29  {
30  v = (int64 *)omAlloc0(sizeof(int64)*l);
31  row = l;
32  col = 1;
33  }
34  int64vec(int r, int c, int64 init);
35  int64vec(int64vec* iv);
36  int64vec(intvec* iv);
38  {
39 #ifndef SING_NDEBUG
40  if((i<0)||(i>=row*col))
41  {
42  Werror("wrong int64vec index:%d\n",i);
43  }
44 #endif
45  return v[i];
46  }
47  inline const int64& operator[](int i) const
48  {
49 #ifndef SING_NDEBUG
50  if((i<0)||(i>=row*col))
51  {
52  Werror("wrong int64vec index:%d\n",i);
53  }
54 #endif
55  return v[i];
56  }
57  void operator*=(int64 intop);
58  void operator/=(int64 intop);
59  // -2: not compatible, -1: <, 0:=, 1: >
60  int compare(const int64vec* o) const;
61  int length() const { return col*row; }
62  int cols() const { return col; }
63  int rows() const { return row; }
64  void show(int mat=0,int spaces=0);
65  char * String(int dim = 2);
66  char * iv64String(int not_mat=1,int mat=0,int spaces=0, int dim=2);
67  int64 * iv64GetVec() { return v; }
69  {
70  if (v!=NULL)
71  {
72  omFreeSize((ADDRESS)v,sizeof(int64)*row*col);
73  v=NULL;
74  }
75  }
76  void iv64TEST()
77  {
79  }
80 };
81 inline int64vec * iv64Copy(int64vec * o)
82 {
83  int64vec * iv=new int64vec(o);
84  return iv;
85 }
86 
89 
90 #ifdef MDEBUG
91 #define iv64Test(v) v->iv64TEST()
92 #else
93 #define iv64Test(v) do {} while (0)
94 #endif
95 
96 #endif
dim
int dim(ideal I, ring r)
Definition: tropicalStrategy.cc:23
iv64Add
int64vec * iv64Add(int64vec *a, int64vec *b)
Definition: int64vec.cc:173
omCheckAddrSize
#define omCheckAddrSize(addr, size)
Definition: omAllocDecl.h:327
omalloc.h
omallocClass.h
ADDRESS
void * ADDRESS
Definition: auxiliary.h:133
int64vec::operator[]
int64 & operator[](int i)
Definition: int64vec.h:37
int64vec::col
int col
Definition: int64vec.h:25
int64vec::iv64TEST
void iv64TEST()
Definition: int64vec.h:76
auxiliary.h
All the auxiliary stuff.
int64vec::row
int row
Definition: int64vec.h:24
b
CanonicalForm b
Definition: cfModGcd.cc:4044
int64vec::rows
int rows() const
Definition: int64vec.h:63
i
int i
Definition: cfEzgcd.cc:125
int64vec
Definition: int64vec.h:21
int64vec::operator/=
void operator/=(int64 intop)
Definition: int64vec.cc:125
omFreeSize
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
int64vec::~int64vec
~int64vec()
Definition: int64vec.h:68
intvec
Definition: intvec.h:21
int64vec::length
int length() const
Definition: int64vec.h:61
int64vec::iv64String
char * iv64String(int not_mat=1, int mat=0, int spaces=0, int dim=2)
Definition: int64vec.cc:57
intvec.h
int64vec::String
char * String(int dim=2)
Definition: int64vec.cc:100
omallocClass
Definition: omallocClass.h:18
int64vec::show
void show(int mat=0, int spaces=0)
Definition: int64vec.cc:105
int64vec::v
int64 * v
Definition: int64vec.h:23
iv64Sub
int64vec * iv64Sub(int64vec *a, int64vec *b)
Definition: int64vec.cc:203
int64vec::iv64GetVec
int64 * iv64GetVec()
Definition: int64vec.h:67
Werror
void Werror(const char *fmt,...)
Definition: reporter.cc:189
int64
long int64
Definition: auxiliary.h:66
int64vec::int64vec
int64vec(int l=1)
Definition: int64vec.h:28
int64vec::cols
int cols() const
Definition: int64vec.h:62
NULL
#define NULL
Definition: omList.c:10
l
int l
Definition: cfEzgcd.cc:93
int64vec::operator*=
void operator*=(int64 intop)
Definition: int64vec.cc:120
iv64Copy
int64vec * iv64Copy(int64vec *o)
Definition: int64vec.h:81
int64vec::compare
int compare(const int64vec *o) const
Definition: int64vec.cc:139
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int64vec::operator[]
const int64 & operator[](int i) const
Definition: int64vec.h:47