/usr/include/singular/singular/misc/int64vec.h is in libsingular4-dev-common 1:4.1.0-p3+ds-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | #ifndef INT64VEC_H
#define INT64VEC_H
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/*
* ABSTRACT: class intvec: lists/vectors of int64
*/
#include <string.h>
#include <misc/auxiliary.h>
#include <omalloc/omallocClass.h>
#include <misc/intvec.h>
class int64vec :public omallocClass
{
private:
int64 *v;
int row;
int col;
public:
int64vec(int l = 1)
{
v = (int64 *)omAlloc0(sizeof(int64)*l);
row = l;
col = 1;
}
int64vec(int r, int c, int64 init);
int64vec(int64vec* iv);
int64vec(intvec* iv);
int64& operator[](int i)
{
#ifndef SING_NDEBUG
if((i<0)||(i>=row*col))
{
Werror("wrong int64vec index:%d\n",i);
}
#endif
return v[i];
}
inline const int64& operator[](int i) const
{
#ifndef SING_NDEBUG
if((i<0)||(i>=row*col))
{
Werror("wrong int64vec index:%d\n",i);
}
#endif
return v[i];
}
void operator*=(int64 intop);
void operator/=(int64 intop);
// -2: not compatible, -1: <, 0:=, 1: >
int compare(const int64vec* o) const;
int length() const { return col*row; }
int cols() const { return col; }
int rows() const { return row; }
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() { return v; }
~int64vec()
{
if (v!=NULL)
{
omFreeSize((ADDRESS)v,sizeof(int64)*row*col);
v=NULL;
}
}
void iv64TEST()
{
omCheckAddrSize((ADDRESS)v,sizeof(int64)*row*col);
}
};
inline int64vec * iv64Copy(int64vec * o)
{
int64vec * iv=new int64vec(o);
return iv;
}
int64vec * iv64Add(int64vec * a, int64vec * b);
int64vec * iv64Sub(int64vec * a, int64vec * b);
#ifdef MDEBUG
#define iv64Test(v) v->iv64TEST()
#else
#define iv64Test(v) do {} while (0)
#endif
#endif
|