Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

ZeroOne Class Template Reference
[linbox/blackbox]

#include <zero-one.h>

Inheritance diagram for ZeroOne:

BlackboxInterface

Detailed Description

template<class Field>
class LinBox::ZeroOne< Field >

Time and space efficient representation of sparse {0,1}-matrices.

A 0-1 matrix is a matrix with all 0's and 1's as entries. We're using a NAG-sparse format. Applies can be performed fast, using only additions. When initalizing this class, you only need to build 2 arrays of equal length: an array of the row indices for the non-zero (1's) entries, and an array of the column indices for the non-zero (1's) entries.

A {0, 1,-1} matrix can be effecively represented as the Dif of two ZeroOne's.


Public Member Functions

 ZeroOne ()
 ZeroOne (Field F, Index *rowP, Index *colP, Index rows, Index cols, Index NNz, bool rowSort=false, bool colSort=false)
 ~ZeroOne ()
template<class OutVector, class InVector> OutVector & apply (OutVector &y, const InVector &x) const
template<class OutVector, class InVector> OutVector & applyTranspose (OutVector &y, const InVector &x) const
size_t rowdim () const
size_t coldim () const
RawIterator rawBegin ()
RawIterator rawEnd ()
const RawIterator rawBegin () const
const RawIterator rawEnd () const
RawIndexIterator indexBegin ()
const RawIndexIterator indexBegin () const
RawIndexIterator indexEnd ()
const RawIndexIterator indexEnd () const
std::ostream & write (std::ostream &out=std::cout)
const Fieldfield () const

Protected Types

typedef Field::Element Element
typedef size_t Index
typedef LinBox::uint32 uint32
typedef LinBox::uint64 uint64

Protected Member Functions

size_t nnz () const
void rowSort () const
void colSort () const
void _qsort (size_t start, size_t endp1, int &mode) const
size_t _part (size_t start, size_t endp1, int &mode) const

Protected Attributes

Field _F
Element _tmp
Index _rows
Index _cols
Index _nnz
Index_rowP
Index_colP
bool _rowSort
bool _colSort
bool dynamic


Member Typedef Documentation

typedef Field::Element Element [protected]
 

typedef size_t Index [protected]
 

typedef LinBox::uint32 uint32 [protected]
 

typedef LinBox::uint64 uint64 [protected]
 


Constructor & Destructor Documentation

ZeroOne  ) 
 

ZeroOne Field  F,
Index rowP,
Index colP,
Index  rows,
Index  cols,
Index  NNz,
bool  rowSort = false,
bool  colSort = false
 

~ZeroOne  ) 
 


Member Function Documentation

OutVector& apply OutVector &  y,
const InVector &  x
const [inline]
 

Uses one of the three private utility functions. It calls the generalized utility function _apply if there is no special ordering, _fyapply if there is C_ordering or _fxapply if there is fortran_ordering

OutVector& applyTranspose OutVector &  y,
const InVector &  x
const [inline]
 

Uses one of the three private utility functions, in the manner described above. Worthy of note is the fact that applyTranspose works by passing the column positions to the _apply functions as if they were rows, and row positions as if they were columns, as if the matrix had been transposed.

size_t rowdim  )  const [inline]
 

size_t coldim  )  const [inline]
 

RawIterator rawBegin  ) 
 

RawIterator rawEnd  ) 
 

const RawIterator rawBegin  )  const
 

const RawIterator rawEnd  )  const
 

RawIndexIterator indexBegin  ) 
 

const RawIndexIterator indexBegin  )  const
 

RawIndexIterator indexEnd  ) 
 

const RawIndexIterator indexEnd  )  const
 

std::ostream& write std::ostream &  out = std::cout  )  [inline]
 

const Field& field  )  const [inline]
 

size_t nnz  )  const [inline, protected]
 

void rowSort  )  const [protected]
 

void colSort  )  const [protected]
 

void _qsort size_t  start,
size_t  endp1,
int &  mode
const [protected]
 

size_t _part size_t  start,
size_t  endp1,
int &  mode
const [protected]
 


Field Documentation

Field _F [protected]
 

Element _tmp [protected]
 

Index _rows [protected]
 

Index _cols [protected]
 

Index _nnz [protected]
 

Index* _rowP [mutable, protected]
 

Index * _colP [mutable, protected]
 

bool _rowSort [mutable, protected]
 

bool _colSort [mutable, protected]
 

bool dynamic [protected]
 


Generated on Fri Jul 8 10:29:50 2005 for linbox by doxygen 1.3.7