ConicBundle
Classes | Namespaces | Functions
indexmat.hxx File Reference

Header declaring the classes CH_Matrix_Classes::Range and CH_Matrix_Classes::Indexmatrix for supporting integral matrices, typically needed for indexing purposes. More...

#include <iostream>
#include <iomanip>
#include <vector>
#include <math.h>
#include "memarray.hxx"
#include "mymath.hxx"
#include "matrix.hxx"

Go to the source code of this file.

Classes

class  CH_Matrix_Classes::Range
 allows to specify a range of integral values via (from, to, step) meaning {j=from+i*step:j in[from,to],i in {0,1,2,...}} More...
 
class  CH_Matrix_Classes::Indexmatrix
 Matrix class for integral values of type Integer More...
 

Namespaces

 CH_Matrix_Classes
 Matrix Classes and Linear Algebra. See Matrix Classes (namespace CH_Matrix_Classes) for a quick introduction.
 

Functions

Indexmatrix CH_Matrix_Classes::diag (const Indexmatrix &A)
 returns a column vector v consisting of the elements v(i)=A(i,i), 0<=i<min(row dimension,column dimension)
 
void CH_Matrix_Classes::swap (Indexmatrix &A, Indexmatrix &B)
 swap the content of the two matrices A and B (involves no copying)
 
Indexmatrix & CH_Matrix_Classes::xbpeya (Indexmatrix &x, const Indexmatrix &y, Integer alpha=1, Integer beta=0, int ytrans=0)
 returns x= alpha*y+beta*x, where y may be transposed (ytrans=1); if beta==0. then x is initialized to the correct size More...
 
Indexmatrix & CH_Matrix_Classes::xeyapzb (Indexmatrix &x, const Indexmatrix &y, const Indexmatrix &z, Integer alpha=1, Integer beta=1)
 returns x= alpha*y+beta*z; x is initialized to the correct size; alpha and beta have default value 1 More...
 
Indexmatrix & CH_Matrix_Classes::genmult (const Indexmatrix &A, const Indexmatrix &B, Indexmatrix &C, Integer alpha=1, Integer beta=0, int atrans=0, int btrans=0)
 returns C=beta*C+alpha*A*B, where A and B may be transposed; C must not be equal to A and B; if beta==0 then C is initialized to the correct size
 
Indexmatrix CH_Matrix_Classes::transpose (const Indexmatrix &A)
 returns an Indexmatrix that is the transpose of A
 
Indexmatrix CH_Matrix_Classes::abs (const Indexmatrix &A)
 returns an Indexmatrix B with entries B(i,j)=abs(A(i,j))
 
Integer CH_Matrix_Classes::trace (const Indexmatrix &A)
 returns the sum of the diagonal elements A(i,i) over all i
 
Indexmatrix CH_Matrix_Classes::sumrows (const Indexmatrix &A)
 returns a row vector holding the sum over all rows, i.e., (1 1 ... 1)*A
 
Indexmatrix CH_Matrix_Classes::sumcols (const Indexmatrix &A)
 returns a column vector holding the sum over all columns, i.e., A*(1 1 ... 1)^T
 
Integer CH_Matrix_Classes::sum (const Indexmatrix &A)
 returns the sum over all elements of A, i.e., (1 1 ... 1)*A*(1 1 ... 1)^T
 
Indexmatrix CH_Matrix_Classes::operator< (const Indexmatrix &A, const Indexmatrix &B)
 returns a matrix having elements (i,j)=Integer(A(i,j)<B(i,j)) for all i,j
 
Indexmatrix CH_Matrix_Classes::operator<= (const Indexmatrix &A, const Indexmatrix &B)
 returns a matrix having elements (i,j)=Integer(A(i,j)<=B(i,j)) for all i,j
 
Indexmatrix CH_Matrix_Classes::operator== (const Indexmatrix &A, const Indexmatrix &B)
 returns a matrix having elements (i,j)=Integer(A(i,j)==B(i,j)) for all i,j
 
Indexmatrix CH_Matrix_Classes::operator!= (const Indexmatrix &A, const Indexmatrix &B)
 returns a matrix having elements (i,j)=Integer(A(i,j)!=B(i,j)) for all i,j
 
Indexmatrix CH_Matrix_Classes::operator< (const Indexmatrix &A, Integer d)
 returns a matrix having elements (i,j)=Integer(A(i,j)<d) for all i,j
 
Indexmatrix CH_Matrix_Classes::operator> (const Indexmatrix &A, Integer d)
 returns a matrix having elements (i,j)=Integer(A(i,j)>d) for all i,j
 
Indexmatrix CH_Matrix_Classes::operator<= (const Indexmatrix &A, Integer d)
 returns a matrix having elements (i,j)=Integer(A(i,j)<=d) for all i,j
 
Indexmatrix CH_Matrix_Classes::operator>= (const Indexmatrix &A, Integer d)
 returns a matrix having elements (i,j)=Integer(A(i,j)>=d) for all i,j
 
Indexmatrix CH_Matrix_Classes::operator== (const Indexmatrix &A, Integer d)
 returns a matrix having elements (i,j)=Integer(A(i,j)==d) for all i,j
 
Indexmatrix CH_Matrix_Classes::operator!= (const Indexmatrix &A, Integer d)
 returns a matrix having elements (i,j)=Integer(A(i,j)!=d) for all i,j
 
Indexmatrix CH_Matrix_Classes::minrows (const Indexmatrix &A)
 returns a row vector holding in each column the minimum over all rows in this column
 
Indexmatrix CH_Matrix_Classes::mincols (const Indexmatrix &A)
 returns a column vector holding in each row the minimum over all columns in this row
 
Integer CH_Matrix_Classes::min (const Indexmatrix &A, Integer *iindex=0, Integer *jindex=0)
 returns the minimum value over all elements of the matrix
 
Indexmatrix CH_Matrix_Classes::maxrows (const Indexmatrix &A)
 returns a row vector holding in each column the maximum over all rows in this column
 
Indexmatrix CH_Matrix_Classes::maxcols (const Indexmatrix &A)
 returns a column vector holding in each row the maximum over all columns in this row
 
Integer CH_Matrix_Classes::max (const Indexmatrix &A, Integer *iindex=0, Integer *jindex=0)
 returns the maximum value over all elements of the matrix
 
Indexmatrix CH_Matrix_Classes::sortindex (const Indexmatrix &vec, bool nondecreasing=true)
 returns an Indexmatrix ind so that vec(ind(0))<=vec(ind(1))<=...<=vec(ind(vec.dim()-1)) (vec may be rectangular, set nondecreasing=false for opposite order)
 
void CH_Matrix_Classes::sortindex (const Indexmatrix &vec, Indexmatrix &ind, bool nondecreasing=true)
 sets ind so that vec(ind(0))<=vec(ind(1))<=...<=vec(ind(vec.dim()-1)) (vec may be rectangular, set nondecreasing=false for opposite order)
 
std::ostream & CH_Matrix_Classes::operator<< (std::ostream &o, const Indexmatrix &A)
 output format (all Integer values): nr nc \n A(1,1) A(1,2) ... A(1,nc) \n A(2,1) ... A(nr,nc) \n
 
std::istream & CH_Matrix_Classes::operator>> (std::istream &i, Indexmatrix &A)
 input format (all Integer values): nr nc \n A(1,1) A(1,2) ... A(1,nc) \n A(2,1) ... A(nr,nc) \n
 

Detailed Description

Header declaring the classes CH_Matrix_Classes::Range and CH_Matrix_Classes::Indexmatrix for supporting integral matrices, typically needed for indexing purposes.

Version
1.0
Date
2005-03-01
Author
Christoph Helmberg