My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
libpolys
misc
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
12
#include "
misc/auxiliary.h
"
13
#include "
omalloc/omalloc.h
"
14
#ifdef HAVE_OMALLOC
15
#include "
omalloc/omallocClass.h
"
16
#endif
17
18
#include "
misc/intvec.h
"
19
20
class
int64vec
21
#ifdef HAVE_OMALLOC
22
:
public
omallocClass
23
#endif
24
{
25
private
:
26
int64
*
v
;
27
int
row
;
28
int
col
;
29
public
:
30
31
int64vec
(
int
l
= 1)
32
{
33
v
= (
int64
*)
omAlloc0
(
sizeof
(
int64
)*
l
);
34
row
=
l
;
35
col
= 1;
36
}
37
int64vec
(
int
r,
int
c,
int64
init);
38
int64vec
(
int64vec
* iv);
39
int64vec
(
intvec
* iv);
40
int64
&
operator[]
(
int
i
)
41
{
42
#ifndef SING_NDEBUG
43
if
((
i
<0)||(
i
>=
row
*
col
))
44
{
45
Werror
(
"wrong int64vec index:%d\n"
,
i
);
46
}
47
#endif
48
return
v
[
i
];
49
}
50
inline
const
int64
&
operator[]
(
int
i
)
const
51
{
52
#ifndef SING_NDEBUG
53
if
((
i
<0)||(
i
>=
row
*
col
))
54
{
55
Werror
(
"wrong int64vec index:%d\n"
,
i
);
56
}
57
#endif
58
return
v
[
i
];
59
}
60
void
operator*=
(
int64
intop);
61
void
operator/=
(
int64
intop);
62
// -2: not compatible, -1: <, 0:=, 1: >
63
int
compare
(
const
int64vec
* o)
const
;
64
int
length
()
const
{
return
col
*
row
; }
65
int
cols
()
const
{
return
col
; }
66
int
rows
()
const
{
return
row
; }
67
void
show
(
int
mat=0,
int
spaces=0);
68
char
*
String
(
int
dim
= 2);
69
char
*
iv64String
(
int
not_mat=1,
int
mat=0,
int
spaces=0,
int
dim
=2);
70
int64
*
iv64GetVec
() {
return
v
; }
71
~int64vec
()
72
{
73
if
(
v
!=
NULL
)
74
{
75
omFreeSize
((
ADDRESS
)
v
,
sizeof
(
int64
)*
row
*
col
);
76
v
=
NULL
;
77
}
78
}
79
void
iv64TEST
()
80
{
81
omCheckAddrSize
((
ADDRESS
)
v
,
sizeof
(
int64
)*
row
*
col
);
82
}
83
};
84
inline
int64vec
*
iv64Copy
(
int64vec
* o)
85
{
86
int64vec
* iv=
new
int64vec
(o);
87
return
iv;
88
}
89
90
int64vec
*
iv64Add
(
int64vec
* a,
int64vec
*
b
);
91
int64vec
*
iv64Sub
(
int64vec
* a,
int64vec
*
b
);
92
93
#ifdef MDEBUG
94
#define iv64Test(v) v->iv64TEST()
95
#else
96
#define iv64Test(v) do {} while (0)
97
#endif
98
99
#endif
auxiliary.h
All the auxiliary stuff.
int64
long int64
Definition
auxiliary.h:68
ADDRESS
void * ADDRESS
Definition
auxiliary.h:120
l
int l
Definition
cfEzgcd.cc:100
i
int i
Definition
cfEzgcd.cc:132
b
CanonicalForm b
Definition
cfModGcd.cc:4111
int64vec
Definition
int64vec.h:24
int64vec::col
int col
Definition
int64vec.h:28
int64vec::iv64GetVec
int64 * iv64GetVec()
Definition
int64vec.h:70
int64vec::show
void show(int mat=0, int spaces=0)
Definition
int64vec.cc:104
int64vec::compare
int compare(const int64vec *o) const
Definition
int64vec.cc:138
int64vec::length
int length() const
Definition
int64vec.h:64
int64vec::int64vec
int64vec(int l=1)
Definition
int64vec.h:31
int64vec::iv64TEST
void iv64TEST()
Definition
int64vec.h:79
int64vec::v
int64 * v
Definition
int64vec.h:26
int64vec::~int64vec
~int64vec()
Definition
int64vec.h:71
int64vec::String
char * String(int dim=2)
Definition
int64vec.cc:99
int64vec::operator[]
int64 & operator[](int i)
Definition
int64vec.h:40
int64vec::operator[]
const int64 & operator[](int i) const
Definition
int64vec.h:50
int64vec::row
int row
Definition
int64vec.h:27
int64vec::iv64String
char * iv64String(int not_mat=1, int mat=0, int spaces=0, int dim=2)
Definition
int64vec.cc:56
int64vec::operator*=
void operator*=(int64 intop)
Definition
int64vec.cc:119
int64vec::rows
int rows() const
Definition
int64vec.h:66
int64vec::cols
int cols() const
Definition
int64vec.h:65
int64vec::operator/=
void operator/=(int64 intop)
Definition
int64vec.cc:124
intvec
Definition
intvec.h:24
omallocClass
Definition
omallocClass.h:20
iv64Add
int64vec * iv64Add(int64vec *a, int64vec *b)
Definition
int64vec.cc:172
iv64Sub
int64vec * iv64Sub(int64vec *a, int64vec *b)
Definition
int64vec.cc:202
iv64Copy
int64vec * iv64Copy(int64vec *o)
Definition
int64vec.h:84
intvec.h
omFreeSize
#define omFreeSize(addr, size)
Definition
omAllocDecl.h:260
omCheckAddrSize
#define omCheckAddrSize(addr, size)
Definition
omAllocDecl.h:327
omAlloc0
#define omAlloc0(size)
Definition
omAllocDecl.h:211
NULL
#define NULL
Definition
omList.c:12
omallocClass.h
omalloc.h
Werror
void Werror(const char *fmt,...)
Definition
reporter.cc:189
dim
int dim(ideal I, ring r)
Definition
tropicalStrategy.cc:23
Generated on
for My Project by
doxygen 1.17.0
for
Singular