Loading...
Searching...
No Matches
int64vec.h
Go to the documentation of this file.
#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 "misc/auxiliary.h"
#include "omalloc/omalloc.h"
#ifdef HAVE_OMALLOC
#include "omalloc/omallocClass.h"
#endif
#include "misc/intvec.h"
class int64vec
#ifdef HAVE_OMALLOC
:public omallocClass
#endif
{
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
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