Loading...
Searching...
No Matches
ap::template_2d_array< T > Class Template Reference

`#include <ap.h>`

## Public Member Functions

| template_2d_array ()
| ~template_2d_array ()
| template_2d_array (const template_2d_array &rhs)
const template_2d_array & | operator= (const template_2d_array &rhs)
const T & | operator() (int i1, int i2) const
T & | operator() (int i1, int i2)
void | setbounds (int iLow1, int iHigh1, int iLow2, int iHigh2)
void | setcontent (int iLow1, int iHigh1, int iLow2, int iHigh2, const T *pContent)
T * | getcontent ()
const T * | getcontent () const
int | getlowbound (int iBoundNum) const
int | gethighbound (int iBoundNum) const
raw_vector< T > | getcolumn (int iColumn, int iRowStart, int iRowEnd)
raw_vector< T > | getrow (int iRow, int iColumnStart, int iColumnEnd)
const_raw_vector< T > | getcolumn (int iColumn, int iRowStart, int iRowEnd) const
const_raw_vector< T > | getrow (int iRow, int iColumnStart, int iColumnEnd) const
| template_2d_array ()
| ~template_2d_array ()
| template_2d_array (const template_2d_array &rhs)
const template_2d_array & | operator= (const template_2d_array &rhs)
const T & | operator() (int i1, int i2) const
T & | operator() (int i1, int i2)
void | setbounds (int iLow1, int iHigh1, int iLow2, int iHigh2)
void | setcontent (int iLow1, int iHigh1, int iLow2, int iHigh2, const T *pContent)
T * | getcontent ()
const T * | getcontent () const
int | getlowbound (int iBoundNum) const
int | gethighbound (int iBoundNum) const
raw_vector< T > | getcolumn (int iColumn, int iRowStart, int iRowEnd)
raw_vector< T > | getrow (int iRow, int iColumnStart, int iColumnEnd)
const_raw_vector< T > | getcolumn (int iColumn, int iRowStart, int iRowEnd) const
const_raw_vector< T > | getrow (int iRow, int iColumnStart, int iColumnEnd) const

## Private Member Functions

bool | wrongRow (int i) const
bool | wrongColumn (int j) const
bool | wrongRow (int i) const
bool | wrongColumn (int j) const

## Private Attributes

T * | m_Vec
long | m_iVecSize
long | m_iLow1
long | m_iLow2
long | m_iHigh1
long | m_iHigh2
long | m_iConstOffset
long | m_iLinearMember

## Detailed Description

template<class T>
class ap::template_2d_array< T >

Definition at line 806 of file ap.h.

## Constructor & Destructor Documentation

## template_2d_array() [1/4]

template<class T>

ap::template_2d_array< T >::template_2d_array | ( |  | ) |

inline

Definition at line 809 of file ap.h.

{
m_Vec=0;
m_iVecSize=0;
};
ap::template_2d_array::m_Vec
T * m_Vec
Definition ap.h:966
ap::template_2d_array::m_iVecSize
long m_iVecSize
Definition ap.h:967

## ~template_2d_array() [1/2]

template<class T>

ap::template_2d_array< T >::~template_2d_array | ( |  | ) |

inline

Definition at line 815 of file ap.h.

{
if(m_Vec)
delete[] m_Vec;
};

## template_2d_array() [2/4]

template<class T>

ap::template_2d_array< T >::template_2d_array | ( | const template_2d_array< T > & | rhs | ) |

inline

Definition at line 821 of file ap.h.

{
m_iVecSize = rhs.m_iVecSize;
m_iLow1 = rhs.m_iLow1;
m_iLow2 = rhs.m_iLow2;
m_iHigh1 = rhs.m_iHigh1;
m_iHigh2 = rhs.m_iHigh2;
m_iConstOffset = rhs.m_iConstOffset;
m_iLinearMember = rhs.m_iLinearMember;
if(rhs.m_Vec)
{
m_Vec = new T[m_iVecSize];
#ifndef UNSAFE_MEM_COPY
for(int i=0; i<m_iVecSize; i++)
m_Vec[i] = rhs.m_Vec[i];
#else
memcpy(m_Vec, rhs.m_Vec, m_iVecSize*sizeof(T));
#endif
}
else
m_Vec=0;
};
ap::template_2d_array
Definition ap.h:807
ap::template_2d_array::m_iConstOffset
long m_iConstOffset
Definition ap.h:969
ap::template_2d_array::m_iHigh1
long m_iHigh1
Definition ap.h:968
ap::template_2d_array::m_iLow2
long m_iLow2
Definition ap.h:968
ap::template_2d_array::m_iLinearMember
long m_iLinearMember
Definition ap.h:969
ap::template_2d_array::m_iHigh2
long m_iHigh2
Definition ap.h:968
ap::template_2d_array::m_iLow1
long m_iLow1
Definition ap.h:968

## template_2d_array() [3/4]

template<class T>

ap::template_2d_array< T >::template_2d_array | ( |  | ) |

inline

Definition at line 818 of file svd_si.h.

{
m_Vec=0;
m_iVecSize=0;
};

## ~template_2d_array() [2/2]

template<class T>

ap::template_2d_array< T >::~template_2d_array | ( |  | ) |

inline

Definition at line 824 of file svd_si.h.

{
if(m_Vec)
delete[] m_Vec;
};

## template_2d_array() [4/4]

template<class T>

ap::template_2d_array< T >::template_2d_array | ( | const template_2d_array< T > & | rhs | ) |

inline

Definition at line 830 of file svd_si.h.

{
m_iVecSize = rhs.m_iVecSize;
m_iLow1 = rhs.m_iLow1;
m_iLow2 = rhs.m_iLow2;
m_iHigh1 = rhs.m_iHigh1;
m_iHigh2 = rhs.m_iHigh2;
m_iConstOffset = rhs.m_iConstOffset;
m_iLinearMember = rhs.m_iLinearMember;
if(rhs.m_Vec)
{
m_Vec = new T[m_iVecSize];
#ifndef UNSAFE_MEM_COPY
for(int i=0; i<m_iVecSize; i++)
m_Vec[i] = rhs.m_Vec[i];
#else
memcpy(m_Vec, rhs.m_Vec, m_iVecSize*sizeof(T));
#endif
}
else
m_Vec=0;
};

## Member Function Documentation

## getcolumn() [1/4]

template<class T>

raw_vector< T > ap::template_2d_array< T >::getcolumn | ( | int | iColumn,
|  | int | iRowStart,
|  | int | iRowEnd )

inline

Definition at line 931 of file ap.h.

{
if( (iRowStart>iRowEnd) || wrongColumn(iColumn) || wrongRow(iRowStart) ||wrongRow(iRowEnd) )
return raw_vector<T>(0, 0, 1);
else
return raw_vector<T>(&((*this)(iRowStart, iColumn)), iRowEnd-iRowStart+1, m_iLinearMember);
};
ap::template_2d_array::wrongRow
bool wrongRow(int i) const
Definition ap.h:963
ap::template_2d_array::wrongColumn
bool wrongColumn(int j) const
Definition ap.h:964

## getcolumn() [2/4]

template<class T>

raw_vector< T > ap::template_2d_array< T >::getcolumn | ( | int | iColumn,
|  | int | iRowStart,
|  | int | iRowEnd )

inline

Definition at line 940 of file svd_si.h.

{
if( (iRowStart>iRowEnd) || wrongColumn(iColumn) || wrongRow(iRowStart) ||wrongRow(iRowEnd) )
return raw_vector<T>(0, 0, 1);
else
return raw_vector<T>(&((*this)(iRowStart, iColumn)), iRowEnd-iRowStart+1, m_iLinearMember);
};

## getcolumn() [3/4]

template<class T>

const_raw_vector< T > ap::template_2d_array< T >::getcolumn | ( | int | iColumn,
|  | int | iRowStart,
|  | int | iRowEnd ) const

inline

Definition at line 947 of file ap.h.

{
if( (iRowStart>iRowEnd) || wrongColumn(iColumn) || wrongRow(iRowStart) ||wrongRow(iRowEnd) )
return const_raw_vector<T>(0, 0, 1);
else
return const_raw_vector<T>(&((*this)(iRowStart, iColumn)), iRowEnd-iRowStart+1, m_iLinearMember);
};

## getcolumn() [4/4]

template<class T>

const_raw_vector< T > ap::template_2d_array< T >::getcolumn | ( | int | iColumn,
|  | int | iRowStart,
|  | int | iRowEnd ) const

inline

Definition at line 956 of file svd_si.h.

{
if( (iRowStart>iRowEnd) || wrongColumn(iColumn) || wrongRow(iRowStart) ||wrongRow(iRowEnd) )
return const_raw_vector<T>(0, 0, 1);
else
return const_raw_vector<T>(&((*this)(iRowStart, iColumn)), iRowEnd-iRowStart+1, m_iLinearMember);
};

## getcontent() [1/4]

template<class T>

T * ap::template_2d_array< T >::getcontent | ( |  | ) |

inline

Definition at line 911 of file ap.h.

{
return m_Vec;
};

## getcontent() [2/4]

template<class T>

T * ap::template_2d_array< T >::getcontent | ( |  | ) |

inline

Definition at line 920 of file svd_si.h.

{
return m_Vec;
};

## getcontent() [3/4]

template<class T>

const T * ap::template_2d_array< T >::getcontent | ( |  | ) | const

inline

Definition at line 916 of file ap.h.

{
return m_Vec;
};

## getcontent() [4/4]

template<class T>

const T * ap::template_2d_array< T >::getcontent | ( |  | ) | const

inline

Definition at line 925 of file svd_si.h.

{
return m_Vec;
};

## gethighbound() [1/2]

template<class T>

int ap::template_2d_array< T >::gethighbound | ( | int | iBoundNum | ) | const

inline

Definition at line 926 of file ap.h.

{
return iBoundNum==1 ? m_iHigh1 : m_iHigh2;
};

## gethighbound() [2/2]

template<class T>

int ap::template_2d_array< T >::gethighbound | ( | int | iBoundNum | ) | const

inline

Definition at line 935 of file svd_si.h.

{
return iBoundNum==1 ? m_iHigh1 : m_iHigh2;
};

## getlowbound() [1/2]

template<class T>

int ap::template_2d_array< T >::getlowbound | ( | int | iBoundNum | ) | const

inline

Definition at line 921 of file ap.h.

{
return iBoundNum==1 ? m_iLow1 : m_iLow2;
};

## getlowbound() [2/2]

template<class T>

int ap::template_2d_array< T >::getlowbound | ( | int | iBoundNum | ) | const

inline

Definition at line 930 of file svd_si.h.

{
return iBoundNum==1 ? m_iLow1 : m_iLow2;
};

## getrow() [1/4]

template<class T>

raw_vector< T > ap::template_2d_array< T >::getrow | ( | int | iRow,
|  | int | iColumnStart,
|  | int | iColumnEnd )

inline

Definition at line 939 of file ap.h.

{
if( (iColumnStart>iColumnEnd) || wrongRow(iRow) || wrongColumn(iColumnStart) || wrongColumn(iColumnEnd))
return raw_vector<T>(0, 0, 1);
else
return raw_vector<T>(&((*this)(iRow, iColumnStart)), iColumnEnd-iColumnStart+1, 1);
};

## getrow() [2/4]

template<class T>

raw_vector< T > ap::template_2d_array< T >::getrow | ( | int | iRow,
|  | int | iColumnStart,
|  | int | iColumnEnd )

inline

Definition at line 948 of file svd_si.h.

{
if( (iColumnStart>iColumnEnd) || wrongRow(iRow) || wrongColumn(iColumnStart) || wrongColumn(iColumnEnd))
return raw_vector<T>(0, 0, 1);
else
return raw_vector<T>(&((*this)(iRow, iColumnStart)), iColumnEnd-iColumnStart+1, 1);
};

## getrow() [3/4]

template<class T>

const_raw_vector< T > ap::template_2d_array< T >::getrow | ( | int | iRow,
|  | int | iColumnStart,
|  | int | iColumnEnd ) const

inline

Definition at line 955 of file ap.h.

{
if( (iColumnStart>iColumnEnd) || wrongRow(iRow) || wrongColumn(iColumnStart) || wrongColumn(iColumnEnd))
return const_raw_vector<T>(0, 0, 1);
else
return const_raw_vector<T>(&((*this)(iRow, iColumnStart)), iColumnEnd-iColumnStart+1, 1);
};

## getrow() [4/4]

template<class T>

const_raw_vector< T > ap::template_2d_array< T >::getrow | ( | int | iRow,
|  | int | iColumnStart,
|  | int | iColumnEnd ) const

inline

Definition at line 964 of file svd_si.h.

{
if( (iColumnStart>iColumnEnd) || wrongRow(iRow) || wrongColumn(iColumnStart) || wrongColumn(iColumnEnd))
return const_raw_vector<T>(0, 0, 1);
else
return const_raw_vector<T>(&((*this)(iRow, iColumnStart)), iColumnEnd-iColumnStart+1, 1);
};

## operator()() [1/4]

template<class T>

T & ap::template_2d_array< T >::operator() | ( | int | i1,
|  | int | i2 )

inline

Definition at line 881 of file ap.h.

{
#ifndef NO_AP_ASSERT
ap_error::make_assertion(i1>=m_iLow1 && i1<=m_iHigh1);
ap_error::make_assertion(i2>=m_iLow2 && i2<=m_iHigh2);
#endif
return m_Vec[ m_iConstOffset + i2 +i1*m_iLinearMember];
};
ap::ap_error::make_assertion
static void make_assertion(bool bClause)
Definition ap.h:49

## operator()() [2/4]

template<class T>

T & ap::template_2d_array< T >::operator() | ( | int | i1,
|  | int | i2 )

inline

Definition at line 890 of file svd_si.h.

{
#ifndef NO_AP_ASSERT
ap_error::make_assertion(i1>=m_iLow1 && i1<=m_iHigh1);
ap_error::make_assertion(i2>=m_iLow2 && i2<=m_iHigh2);
#endif
return m_Vec[ m_iConstOffset + i2 +i1*m_iLinearMember];
};

## operator()() [3/4]

template<class T>

const T & ap::template_2d_array< T >::operator() | ( | int | i1,
|  | int | i2 ) const

inline

Definition at line 872 of file ap.h.

{
#ifndef NO_AP_ASSERT
ap_error::make_assertion(i1>=m_iLow1 && i1<=m_iHigh1);
ap_error::make_assertion(i2>=m_iLow2 && i2<=m_iHigh2);
#endif
return m_Vec[ m_iConstOffset + i2 +i1*m_iLinearMember];
};

## operator()() [4/4]

template<class T>

const T & ap::template_2d_array< T >::operator() | ( | int | i1,
|  | int | i2 ) const

inline

Definition at line 881 of file svd_si.h.

{
#ifndef NO_AP_ASSERT
ap_error::make_assertion(i1>=m_iLow1 && i1<=m_iHigh1);
ap_error::make_assertion(i2>=m_iLow2 && i2<=m_iHigh2);
#endif
return m_Vec[ m_iConstOffset + i2 +i1*m_iLinearMember];
};

## operator=() [1/2]

template<class T>

const template_2d_array & ap::template_2d_array< T >::operator= | ( | const template_2d_array< T > & | rhs | ) |

inline

Definition at line 843 of file ap.h.

{
if( this==&rhs )
return *this;
m_iLow1 = rhs.m_iLow1;
m_iLow2 = rhs.m_iLow2;
m_iHigh1 = rhs.m_iHigh1;
m_iHigh2 = rhs.m_iHigh2;
m_iConstOffset = rhs.m_iConstOffset;
m_iLinearMember = rhs.m_iLinearMember;
m_iVecSize = rhs.m_iVecSize;
if(m_Vec)
delete[] m_Vec;
if(rhs.m_Vec)
{
m_Vec = new T[m_iVecSize];
#ifndef UNSAFE_MEM_COPY
for(int i=0; i<m_iVecSize; i++)
m_Vec[i] = rhs.m_Vec[i];
#else
memcpy(m_Vec, rhs.m_Vec, m_iVecSize*sizeof(T));
#endif
}
else
m_Vec=0;
return *this;
};

## operator=() [2/2]

template<class T>

const template_2d_array & ap::template_2d_array< T >::operator= | ( | const template_2d_array< T > & | rhs | ) |

inline

Definition at line 852 of file svd_si.h.

{
if( this==&rhs )
return *this;
m_iLow1 = rhs.m_iLow1;
m_iLow2 = rhs.m_iLow2;
m_iHigh1 = rhs.m_iHigh1;
m_iHigh2 = rhs.m_iHigh2;
m_iConstOffset = rhs.m_iConstOffset;
m_iLinearMember = rhs.m_iLinearMember;
m_iVecSize = rhs.m_iVecSize;
if(m_Vec)
delete[] m_Vec;
if(rhs.m_Vec)
{
m_Vec = new T[m_iVecSize];
#ifndef UNSAFE_MEM_COPY
for(int i=0; i<m_iVecSize; i++)
m_Vec[i] = rhs.m_Vec[i];
#else
memcpy(m_Vec, rhs.m_Vec, m_iVecSize*sizeof(T));
#endif
}
else
m_Vec=0;
return *this;
};

## setbounds() [1/2]

template<class T>

void ap::template_2d_array< T >::setbounds | ( | int | iLow1,
|  | int | iHigh1,
|  | int | iLow2,
|  | int | iHigh2 )

inline

Definition at line 890 of file ap.h.

{
if(m_Vec)
delete[] m_Vec;
m_iVecSize = (iHigh1-iLow1+1)*(iHigh2-iLow2+1);
m_Vec = new T[m_iVecSize];
m_iLow1 = iLow1;
m_iHigh1 = iHigh1;
m_iLow2 = iLow2;
m_iHigh2 = iHigh2;
m_iConstOffset = -m_iLow2-m_iLow1*(m_iHigh2-m_iLow2+1);
m_iLinearMember = (m_iHigh2-m_iLow2+1);
};

## setbounds() [2/2]

template<class T>

void ap::template_2d_array< T >::setbounds | ( | int | iLow1,
|  | int | iHigh1,
|  | int | iLow2,
|  | int | iHigh2 )

inline

Definition at line 899 of file svd_si.h.

{
if(m_Vec)
delete[] m_Vec;
m_iVecSize = (iHigh1-iLow1+1)*(iHigh2-iLow2+1);
m_Vec = new T[m_iVecSize];
m_iLow1 = iLow1;
m_iHigh1 = iHigh1;
m_iLow2 = iLow2;
m_iHigh2 = iHigh2;
m_iConstOffset = -m_iLow2-m_iLow1*(m_iHigh2-m_iLow2+1);
m_iLinearMember = (m_iHigh2-m_iLow2+1);
};

## setcontent() [1/2]

template<class T>

void ap::template_2d_array< T >::setcontent | ( | int | iLow1,
|  | int | iHigh1,
|  | int | iLow2,
|  | int | iHigh2,
|  | const T * | pContent )

inline

Definition at line 904 of file ap.h.

{
setbounds(iLow1, iHigh1, iLow2, iHigh2);
for(int i=0; i<m_iVecSize; i++)
m_Vec[i]=pContent[i];
};
ap::template_2d_array::setbounds
void setbounds(int iLow1, int iHigh1, int iLow2, int iHigh2)
Definition ap.h:890

## setcontent() [2/2]

template<class T>

void ap::template_2d_array< T >::setcontent | ( | int | iLow1,
|  | int | iHigh1,
|  | int | iLow2,
|  | int | iHigh2,
|  | const T * | pContent )

inline

Definition at line 913 of file svd_si.h.

{
setbounds(iLow1, iHigh1, iLow2, iHigh2);
for(int i=0; i<m_iVecSize; i++)
m_Vec[i]=pContent[i];
};

## wrongColumn() [1/2]

template<class T>

bool ap::template_2d_array< T >::wrongColumn | ( | int | j | ) | const

inline private

Definition at line 964 of file ap.h.

{ return j<m_iLow2 || j>m_iHigh2; };

## wrongColumn() [2/2]

template<class T>

bool ap::template_2d_array< T >::wrongColumn | ( | int | j | ) | const

inline private

Definition at line 973 of file svd_si.h.

{ return j<m_iLow2 || j>m_iHigh2; };

## wrongRow() [1/2]

template<class T>

bool ap::template_2d_array< T >::wrongRow | ( | int | i | ) | const

inline private

Definition at line 963 of file ap.h.

{ return i<m_iLow1 || i>m_iHigh1; };

## wrongRow() [2/2]

template<class T>

bool ap::template_2d_array< T >::wrongRow | ( | int | i | ) | const

inline private

Definition at line 972 of file svd_si.h.

{ return i<m_iLow1 || i>m_iHigh1; };

## Field Documentation

## m_iConstOffset

template<class T>

long ap::template_2d_array< T >::m_iConstOffset

private

Definition at line 969 of file ap.h.

## m_iHigh1

template<class T>

long ap::template_2d_array< T >::m_iHigh1

private

Definition at line 968 of file ap.h.

## m_iHigh2

template<class T>

long ap::template_2d_array< T >::m_iHigh2

private

Definition at line 968 of file ap.h.

## m_iLinearMember

template<class T>

long ap::template_2d_array< T >::m_iLinearMember

private

Definition at line 969 of file ap.h.

## m_iLow1

template<class T>

long ap::template_2d_array< T >::m_iLow1

private

Definition at line 968 of file ap.h.

## m_iLow2

template<class T>

long ap::template_2d_array< T >::m_iLow2

private

Definition at line 968 of file ap.h.

## m_iVecSize

template<class T>

long ap::template_2d_array< T >::m_iVecSize

private

Definition at line 967 of file ap.h.

## m_Vec

template<class T>

T * ap::template_2d_array< T >::m_Vec

private

Definition at line 966 of file ap.h.

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

- Singular/svd/libs/ap.h
- Singular/svd_si.h