GenTMatrix Class Reference

#include <IpGenTMatrix.hpp>

Inheritance diagram for GenTMatrix:

Matrix TaggedObject ReferencedObject Subject

List of all members.


Detailed Description

Class for general matrices stored in triplet format.

In the triplet format, the nonzeros elements of a general matrix is stored in three arrays, Irow, Jcol, and Values, all of length Nonzeros. The first two arrays indicate the location of a non-zero element (row and column indices), and the last array stores the value at that location. If nonzero elements are listed more than once, their values are added.

The structure of the nonzeros (i.e. the arrays Irow and Jcol) cannot be changed after the matrix can been initialized. Only the values of the nonzero elements can be modified.

Note that the first row and column of a matrix has index 1, not 0.

Public Member Functions

Constructors / Destructors
 GenTMatrix (const GenTMatrixSpace *owner_space)
 Constructor, taking the owner_space.
 ~GenTMatrix ()
 Destructor.
Changing the Values.
void SetValues (const Number *Values)
 Set values of nonzero elements.
Accessor Methods
Index Nonzeros () const
 Number of nonzero entries.
const IndexIrows () const
 Array with Row indices (counting starts at 1).
const IndexJcols () const
 Array with Column indices (counting starts at 1).
const NumberValues () const
 Array with nonzero values (const version).
NumberValues ()
 Array with the nonzero values of this matrix (non-const version).

Protected Member Functions

Overloaded methods from Matrix base class
virtual void MultVectorImpl (Number alpha, const Vector &x, Number beta, Vector &y) const
 Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
virtual void TransMultVectorImpl (Number alpha, const Vector &x, Number beta, Vector &y) const
 Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
virtual bool HasValidNumbersImpl () const
 Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
virtual void PrintImpl (const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent, const std::string &prefix) const
 Method for determining if all stored numbers are valid (i.e., no Inf or Nan).


Constructor & Destructor Documentation

GenTMatrix ( const GenTMatrixSpace owner_space  ) 

Constructor, taking the owner_space.

References GenTMatrixSpace::AllocateInternalStorage(), and GenTMatrix::Nonzeros().

~GenTMatrix (  ) 

Destructor.

References GenTMatrixSpace::FreeInternalStorage().


Member Function Documentation

void SetValues ( const Number Values  ) 

Set values of nonzero elements.

The values of the nonzero elements is copied from the incoming Number array. Important: It is assume that the order of the values in Values corresponds to the one of Irn and Jcn given to one of the constructors above.

References Ipopt::IpBlasDcopy(), GenTMatrix::Nonzeros(), and TaggedObject::ObjectChanged().

Index Nonzeros (  )  const [inline]

const Index * Irows (  )  const [inline]

Array with Row indices (counting starts at 1).

References GenTMatrixSpace::Irows().

Referenced by GenTMatrix::MultVectorImpl(), GenTMatrix::PrintImpl(), and GenTMatrix::TransMultVectorImpl().

const Index * Jcols (  )  const [inline]

Array with Column indices (counting starts at 1).

References GenTMatrixSpace::Jcols().

Referenced by GenTMatrix::MultVectorImpl(), GenTMatrix::PrintImpl(), and GenTMatrix::TransMultVectorImpl().

const Number* Values (  )  const [inline]

Array with nonzero values (const version).

Referenced by TNLPAdapter::Eval_jac_c(), and TNLPAdapter::Eval_jac_d().

Number* Values (  )  [inline]

Array with the nonzero values of this matrix (non-const version).

Use this method only if you are intending to change the values, because the GenTMatrix will be marked as changed.

References TaggedObject::ObjectChanged().

void MultVectorImpl ( Number  alpha,
const Vector x,
Number  beta,
Vector y 
) const [protected, virtual]

void TransMultVectorImpl ( Number  alpha,
const Vector x,
Number  beta,
Vector y 
) const [protected, virtual]

bool HasValidNumbersImpl (  )  const [protected, virtual]

Method for determining if all stored numbers are valid (i.e., no Inf or Nan).

Reimplemented from Matrix.

References DBG_ASSERT, Ipopt::IpBlasDasum(), Ipopt::IsFiniteNumber(), GenTMatrix::Nonzeros(), and SimTK::sum().

void PrintImpl ( const Journalist jnlst,
EJournalLevel  level,
EJournalCategory  category,
const std::string &  name,
Index  indent,
const std::string &  prefix 
) const [protected, virtual]

Method for determining if all stored numbers are valid (i.e., no Inf or Nan).

Implements Matrix.

References fkinkryx::i, GenTMatrix::Irows(), GenTMatrix::Jcols(), GenTMatrix::Nonzeros(), Journalist::Printf(), and Journalist::PrintfIndented().


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

Generated on Fri Sep 26 07:44:25 2008 for SimTKcore by  doxygen 1.5.6