Loading...
Searching...
No Matches
multiCnt Class Reference

`#include <multicnt.h>`

## Public Member Functions

| multiCnt ()
| multiCnt (int)
| multiCnt (int, int)
| multiCnt (int, int *)
| multiCnt (const multiCnt &)
void | copy_zero (void)
void | copy_new (int)
void | copy_delete (void)
void | copy_shallow (multiCnt &)
void | copy_deep (const multiCnt &)
void | set (int)
void | inc (void)
void | inc_carry (void)
int | inc (int)

## Data Fields

int * | cnt
int | N
int | last_inc

## Detailed Description

Definition at line 17 of file multicnt.h.

## Constructor & Destructor Documentation

## multiCnt() [1/5]

multiCnt::multiCnt | ( |  | ) |

inline

Definition at line 73 of file multicnt.h.

{
copy_zero( );
}
multiCnt::copy_zero
void copy_zero(void)
Definition multicnt.h:51

## multiCnt() [2/5]

multiCnt::multiCnt | ( | int | n | ) |

Definition at line 118 of file multicnt.cc.

:
last_inc( 0 )
{
copy_new( n );
N = n;
set( 0 );
}
multiCnt::copy_new
void copy_new(int)
Definition multicnt.cc:32
multiCnt::set
void set(int)
Definition multicnt.cc:108
multiCnt::last_inc
int last_inc
Definition multicnt.h:23
multiCnt::N
int N
Definition multicnt.h:22

## multiCnt() [3/5]

multiCnt::multiCnt | ( | int | n,
|  | int | c )

Definition at line 130 of file multicnt.cc.

:
last_inc( 0 )
{
copy_new( n );
N = n;
set( c );
}

## multiCnt() [4/5]

multiCnt::multiCnt | ( | int | n,
|  | int * | c )

Definition at line 142 of file multicnt.cc.

:
last_inc( 0 )
{
copy_new( n );
N = n;
for( int i=0; i<N; i++ ) cnt[i] = c[i];
}
i
int i
Definition cfEzgcd.cc:132
multiCnt::cnt
int * cnt
Definition multicnt.h:21

## multiCnt() [5/5]

multiCnt::multiCnt | ( | const multiCnt & |  | ) |

## Member Function Documentation

## copy_deep()

void multiCnt::copy_deep | ( | const multiCnt & | C | ) |

Definition at line 91 of file multicnt.cc.

{
copy_new( C.N );
last_inc = C.last_inc;
N = C.N;
for( int i=0; i<N; i++ )
{
cnt[i] = C.cnt[i];
}
}

## copy_delete()

void multiCnt::copy_delete | ( | void |  | ) |

Definition at line 81 of file multicnt.cc.

{
if( N>0 && cnt!=(int*)NULL ) delete [] cnt;
copy_zero( );
}
NULL
#define NULL
Definition omList.c:12

## copy_new()

void multiCnt::copy_new | ( | int | n | ) |

Definition at line 32 of file multicnt.cc.

{
if( n > 0 )
{
cnt = new int[n];
#ifndef SING_NDEBUG
if( cnt == (int*)NULL )
{
#ifdef MULTICNT_PRINT
#ifdef MULTICNT_IOSTREAM
cerr << "multiCnt::copy_new(" << n << ")" << endl;
cerr << " returned ZERO!!!" << endl;
cerr << " exit..." << endl;
#else
fprintf( stderr,"multiCnt::copy_new( %d )\n",n );
fprintf( stderr," returned ZERO!!!\n" );
fprintf( stderr," exit...\n" );
#endif
#endif
exit( 1 );
}
#endif
}
else if( n == 0 )
{
cnt = (int*)NULL;
}
else
{
#ifdef MULTICNT_PRINT
#ifdef MULTICNT_IOSTREAM
cerr << "multiCnt::copy_new(" << n << ")" << endl;
cerr << " exit..." << endl;
#else
fprintf( stderr,"multiCnt::copy_new( %d )\n",n );
fprintf( stderr," exit...\n" );
#endif
#endif
exit( 1 );
}
}

## copy_shallow()

void multiCnt::copy_shallow | ( | multiCnt & | C | ) |

inline

Definition at line 62 of file multicnt.h.

{
cnt = C.cnt;
N = C.N;
last_inc = C.last_inc;
}

## copy_zero()

void multiCnt::copy_zero | ( | void |  | ) |

inline

Definition at line 51 of file multicnt.h.

{
cnt = (int*)NULL;
N = 0;
last_inc = 0;
}

## inc() [1/2]

int multiCnt::inc | ( | int | carry | ) |

Definition at line 200 of file multicnt.cc.

{
if( carry==FALSE )
{
inc( );
}
else
{
if( last_inc==N-1 )
{
return FALSE;
}
inc_carry( );
}
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
multiCnt::inc_carry
void inc_carry(void)
Definition multicnt.cc:176
multiCnt::inc
void inc(void)
Definition multicnt.cc:154

## inc() [2/2]

void multiCnt::inc | ( | void |  | ) |

Definition at line 154 of file multicnt.cc.

{
cnt[0]++;
last_inc=0;
}

## inc_carry()

void multiCnt::inc_carry | ( | void |  | ) |

Definition at line 176 of file multicnt.cc.

{
for( int i=0; i<=last_inc; i++ ) cnt[i] = 0;
last_inc++;
cnt[last_inc]++;
}

## set()

void multiCnt::set | ( | int | c | ) |

Definition at line 108 of file multicnt.cc.

{
for( int i=0; i<N; i++ ) cnt[i]=c;
}

## Field Documentation

## cnt

int* multiCnt::cnt

Definition at line 21 of file multicnt.h.

## last_inc

int multiCnt::last_inc

Definition at line 23 of file multicnt.h.

## N

int multiCnt::N

Definition at line 22 of file multicnt.h.

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

- kernel/spectrum/multicnt.h
- kernel/spectrum/multicnt.cc