linbox
ScalarMatrix< Field_ > Class Template Reference

Blackbox for aI. More...

#include <scalar-matrix.h>

+ Inheritance diagram for ScalarMatrix< Field_ >:

Data Structures

struct  rebind
 

Public Types

typedef Field_ Field
 
typedef Field::Element Element
 
typedef ScalarMatrix< FieldSelf_t
 

Public Member Functions

 ScalarMatrix ()
 Constructs an initially 0 by 0 matrix.
 
 ScalarMatrix (MatrixStream< Field > &ms)
 
void changeField (const Field &F)
 
 ScalarMatrix (const Field &F)
 Constructor of readable scalar matrix.
 
 ScalarMatrix (const Field &F, const size_t n, const size_t m, const Element &s)
 
 ScalarMatrix (const Field &F, const size_t n, const size_t m)
 
 ScalarMatrix (const Field &F, const size_t n, const typename Field::RandIter &iter)
 Constructor from a random element.
 
 ScalarMatrix (const ScalarMatrix< Field > &Mat)
 
void setScalar (Element &x)
 
template<class OutVector, class InVector>
OutVector & apply (OutVector &y, InVector &x) const
 Application of BlackBox matrix.
 
template<class OutVector, class InVector>
OutVector & applyTranspose (OutVector &y, InVector &x) const
 Application of BlackBox matrix transpose.
 
template<typename _Tp1>
 ScalarMatrix (const ScalarMatrix< _Tp1 > &S, const Field &F)
 
size_t rowdim (void) const
 
size_t coldim (void) const
 
const Fieldfield () const
 
Elementtrace (Element &t) const
 
ElementgetEntry (Element &x, const size_t i, const size_t j) const
 
Elementdet (Element &d) const
 
long int & rank (long int &r) const
 
ElementgetScalar (Element &x) const
 
ElementsetScalar (const Element &x)
 
std::ostream & write (std::ostream &os, Tag::FileFormat format=Tag::FileFormat::Pretty) const
 
std::istream & read (std::istream &is)
 

Protected Member Functions

template<class OutVector, class InVector>
OutVector & _app (OutVector &y, const InVector &x, VectorCategories::DenseVectorTag) const
 
template<class OutVector, class InVector>
OutVector & _app (OutVector &y, const InVector &x, VectorCategories::SparseSequenceVectorTag) const
 
template<class OutVector, class InVector>
OutVector & _app (OutVector &y, const InVector &x, VectorCategories::SparseAssociativeVectorTag) const
 
Elementpow (Field &F, Element &p, const Element &a, const size_t e)
 

Protected Attributes

const Fieldfield_
 
size_t n_
 
Element v_
 

Detailed Description

template<class Field_>
class LinBox::ScalarMatrix< Field_ >

Blackbox for aI.

Use particularly for representing 0 and I.

This is a class of blackbox square scalar matrices. Each scalar matrix occupies O(scalar-size) memory. The matrix itself is not stored in memory, just the scalar and the dimensions.

Member Typedef Documentation

◆ Field

template<class Field_>
typedef Field_ Field

◆ Element

template<class Field_>
typedef Field::Element Element

◆ Self_t

template<class Field_>
typedef ScalarMatrix<Field> Self_t

Constructor & Destructor Documentation

◆ ScalarMatrix() [1/8]

template<class Field_>
ScalarMatrix ( )
inline

Constructs an initially 0 by 0 matrix.

Bug
this should not be allowed (unknown field)

◆ ScalarMatrix() [2/8]

template<class Field_>
ScalarMatrix ( MatrixStream< Field > & ms)
inline

◆ ScalarMatrix() [3/8]

template<class Field_>
ScalarMatrix ( const Field & F)
inline

Constructor of readable scalar matrix.

Parameters
Ffield in which to do arithmetic.

◆ ScalarMatrix() [4/8]

template<class Field_>
ScalarMatrix ( const Field & F,
const size_t n,
const size_t m,
const Element & s )
inline

◆ ScalarMatrix() [5/8]

template<class Field_>
ScalarMatrix ( const Field & F,
const size_t n,
const size_t m )
inline

◆ ScalarMatrix() [6/8]

template<class Field_>
ScalarMatrix ( const Field & F,
const size_t n,
const typename Field::RandIter & iter )
inline

Constructor from a random element.

Parameters
Ffield in which to do arithmetic.
nsize of the matrix.
iterRandom iterator from which to get the diagonal scalar element.

◆ ScalarMatrix() [7/8]

template<class Field_>
ScalarMatrix ( const ScalarMatrix< Field > & Mat)
inline

◆ ScalarMatrix() [8/8]

template<class Field_>
template<typename _Tp1>
ScalarMatrix ( const ScalarMatrix< _Tp1 > & S,
const Field & F )
inline

Member Function Documentation

◆ changeField()

template<class Field_>
void changeField ( const Field & F)
inline

◆ setScalar() [1/2]

template<class Field_>
void setScalar ( Element & x)
inline

◆ apply()

template<class Field_>
template<class OutVector, class InVector>
OutVector & apply ( OutVector & y,
InVector & x ) const
inline

Application of BlackBox matrix.

y= A*x. Requires time linear in n, the size of the matrix.

◆ applyTranspose()

template<class Field_>
template<class OutVector, class InVector>
OutVector & applyTranspose ( OutVector & y,
InVector & x ) const
inline

Application of BlackBox matrix transpose.

y= transpose(A)*x. Requires time linear in n, the size of the matrix.

◆ rowdim()

template<class Field_>
size_t rowdim ( void ) const
inline

◆ coldim()

template<class Field_>
size_t coldim ( void ) const
inline

◆ field()

template<class Field_>
const Field & field ( ) const
inline

◆ trace()

template<class Field_>
Element & trace ( Element & t) const
inline

◆ getEntry()

template<class Field_>
Element & getEntry ( Element & x,
const size_t i,
const size_t j ) const
inline

◆ det()

template<class Field_>
Element & det ( Element & d) const
inline

◆ rank()

template<class Field_>
long int & rank ( long int & r) const
inline

◆ getScalar()

template<class Field_>
Element & getScalar ( Element & x) const
inline

◆ setScalar() [2/2]

template<class Field_>
Element & setScalar ( const Element & x)
inline

◆ write()

template<class Field_>
std::ostream & write ( std::ostream & os,
Tag::FileFormat format = Tag::FileFormat::Pretty ) const
inline

◆ read()

template<class Field_>
std::istream & read ( std::istream & is)
inline

◆ _app() [1/3]

template<class Field>
template<class OutVector, class InVector>
OutVector & _app ( OutVector & y,
const InVector & x,
VectorCategories::DenseVectorTag t ) const
inlineprotected

◆ _app() [2/3]

template<class Field>
template<class OutVector, class InVector>
OutVector & _app ( OutVector & y,
const InVector & x,
VectorCategories::SparseSequenceVectorTag t ) const
inlineprotected

◆ _app() [3/3]

template<class Field>
template<class OutVector, class InVector>
OutVector & _app ( OutVector & y,
const InVector & x,
VectorCategories::SparseAssociativeVectorTag t ) const
inlineprotected

◆ pow()

template<class Field_>
Element & pow ( Field & F,
Element & p,
const Element & a,
const size_t e )
inlineprotected

Field Documentation

◆ field_

template<class Field_>
const Field* field_
protected

◆ n_

template<class Field_>
size_t n_
protected

◆ v_

template<class Field_>
Element v_
protected

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