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

`#include <ap.h>`

## Public Member Functions

| template_1d_array ()
| ~template_1d_array ()
| template_1d_array (const template_1d_array &rhs)
const template_1d_array & | operator= (const template_1d_array &rhs)
const T & | operator() (int i) const
T & | operator() (int i)
void | setbounds (int iLow, int iHigh)
void | setcontent (int iLow, int iHigh, const T *pContent)
T * | getcontent ()
const T * | getcontent () const
int | getlowbound (int iBoundNum=0) const
int | gethighbound (int iBoundNum=0) const
raw_vector< T > | getvector (int iStart, int iEnd)
const_raw_vector< T > | getvector (int iStart, int iEnd) const
| template_1d_array ()
| ~template_1d_array ()
| template_1d_array (const template_1d_array &rhs)
const template_1d_array & | operator= (const template_1d_array &rhs)
const T & | operator() (int i) const
T & | operator() (int i)
void | setbounds (int iLow, int iHigh)
void | setcontent (int iLow, int iHigh, const T *pContent)
T * | getcontent ()
const T * | getcontent () const
int | getlowbound (int iBoundNum=0) const
int | gethighbound (int iBoundNum=0) const
raw_vector< T > | getvector (int iStart, int iEnd)
const_raw_vector< T > | getvector (int iStart, int iEnd) const

## Private Member Functions

bool | wrongIdx (int i) const
bool | wrongIdx (int i) const

## Private Attributes

T * | m_Vec
long | m_iVecSize
long | m_iLow
long | m_iHigh

## Detailed Description

template<class T>
class ap::template_1d_array< T >

Definition at line 656 of file ap.h.

## Constructor & Destructor Documentation

## template_1d_array() [1/4]

template<class T>

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

inline

Definition at line 659 of file ap.h.

{
m_Vec=0;
m_iVecSize = 0;
};
ap::template_1d_array::m_Vec
T * m_Vec
Definition ap.h:795
ap::template_1d_array::m_iVecSize
long m_iVecSize
Definition ap.h:796

## ~template_1d_array() [1/2]

template<class T>

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

inline

Definition at line 665 of file ap.h.

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

## template_1d_array() [2/4]

template<class T>

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

inline

Definition at line 671 of file ap.h.

{
m_iVecSize = rhs.m_iVecSize;
m_iLow = rhs.m_iLow;
m_iHigh = rhs.m_iHigh;
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_1d_array
Definition ap.h:657
ap::template_1d_array::m_iLow
long m_iLow
Definition ap.h:797
ap::template_1d_array::m_iHigh
long m_iHigh
Definition ap.h:797

## template_1d_array() [3/4]

template<class T>

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

inline

Definition at line 668 of file svd_si.h.

{
m_Vec=0;
m_iVecSize = 0;
};

## ~template_1d_array() [2/2]

template<class T>

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

inline

Definition at line 674 of file svd_si.h.

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

## template_1d_array() [4/4]

template<class T>

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

inline

Definition at line 680 of file svd_si.h.

{
m_iVecSize = rhs.m_iVecSize;
m_iLow = rhs.m_iLow;
m_iHigh = rhs.m_iHigh;
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

## getcontent() [1/4]

template<class T>

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

inline

Definition at line 754 of file ap.h.

{
return m_Vec;
};

## getcontent() [2/4]

template<class T>

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

inline

Definition at line 763 of file svd_si.h.

{
return m_Vec;
};

## getcontent() [3/4]

template<class T>

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

inline

Definition at line 759 of file ap.h.

{
return m_Vec;
};

## getcontent() [4/4]

template<class T>

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

inline

Definition at line 768 of file svd_si.h.

{
return m_Vec;
};

## gethighbound() [1/2]

template<class T>

int ap::template_1d_array< T >::gethighbound | ( | int | iBoundNum = 0 | ) | const

inline

Definition at line 771 of file ap.h.

{
return m_iHigh;
};

## gethighbound() [2/2]

template<class T>

int ap::template_1d_array< T >::gethighbound | ( | int | iBoundNum = 0 | ) | const

inline

Definition at line 780 of file svd_si.h.

{
return m_iHigh;
};

## getlowbound() [1/2]

template<class T>

int ap::template_1d_array< T >::getlowbound | ( | int | iBoundNum = 0 | ) | const

inline

Definition at line 765 of file ap.h.

{
return m_iLow;
};

## getlowbound() [2/2]

template<class T>

int ap::template_1d_array< T >::getlowbound | ( | int | iBoundNum = 0 | ) | const

inline

Definition at line 774 of file svd_si.h.

{
return m_iLow;
};

## getvector() [1/4]

template<class T>

raw_vector< T > ap::template_1d_array< T >::getvector | ( | int | iStart,
|  | int | iEnd )

inline

Definition at line 776 of file ap.h.

{
if( iStart>iEnd || wrongIdx(iStart) || wrongIdx(iEnd) )
return raw_vector<T>(0, 0, 1);
else
return raw_vector<T>(m_Vec+iStart-m_iLow, iEnd-iStart+1, 1);
};
ap::template_1d_array::wrongIdx
bool wrongIdx(int i) const
Definition ap.h:793

## getvector() [2/4]

template<class T>

raw_vector< T > ap::template_1d_array< T >::getvector | ( | int | iStart,
|  | int | iEnd )

inline

Definition at line 785 of file svd_si.h.

{
if( iStart>iEnd || wrongIdx(iStart) || wrongIdx(iEnd) )
return raw_vector<T>(0, 0, 1);
else
return raw_vector<T>(m_Vec+iStart-m_iLow, iEnd-iStart+1, 1);
};

## getvector() [3/4]

template<class T>

const_raw_vector< T > ap::template_1d_array< T >::getvector | ( | int | iStart,
|  | int | iEnd ) const

inline

Definition at line 785 of file ap.h.

{
if( iStart>iEnd || wrongIdx(iStart) || wrongIdx(iEnd) )
return const_raw_vector<T>(0, 0, 1);
else
return const_raw_vector<T>(m_Vec+iStart-m_iLow, iEnd-iStart+1, 1);
};

## getvector() [4/4]

template<class T>

const_raw_vector< T > ap::template_1d_array< T >::getvector | ( | int | iStart,
|  | int | iEnd ) const

inline

Definition at line 794 of file svd_si.h.

{
if( iStart>iEnd || wrongIdx(iStart) || wrongIdx(iEnd) )
return const_raw_vector<T>(0, 0, 1);
else
return const_raw_vector<T>(m_Vec+iStart-m_iLow, iEnd-iStart+1, 1);
};

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

template<class T>

T & ap::template_1d_array< T >::operator() | ( | int | i | ) |

inline

Definition at line 726 of file ap.h.

{
#ifndef NO_AP_ASSERT
ap_error::make_assertion(i>=m_iLow && i<=m_iHigh);
#endif
return m_Vec[ i-m_iLow ];
};
ap::ap_error::make_assertion
static void make_assertion(bool bClause)
Definition ap.h:49

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

template<class T>

T & ap::template_1d_array< T >::operator() | ( | int | i | ) |

inline

Definition at line 735 of file svd_si.h.

{
#ifndef NO_AP_ASSERT
ap_error::make_assertion(i>=m_iLow && i<=m_iHigh);
#endif
return m_Vec[ i-m_iLow ];
};

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

template<class T>

const T & ap::template_1d_array< T >::operator() | ( | int | i | ) | const

inline

Definition at line 717 of file ap.h.

{
#ifndef NO_AP_ASSERT
ap_error::make_assertion(i>=m_iLow && i<=m_iHigh);
#endif
return m_Vec[ i-m_iLow ];
};

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

template<class T>

const T & ap::template_1d_array< T >::operator() | ( | int | i | ) | const

inline

Definition at line 726 of file svd_si.h.

{
#ifndef NO_AP_ASSERT
ap_error::make_assertion(i>=m_iLow && i<=m_iHigh);
#endif
return m_Vec[ i-m_iLow ];
};

## operator=() [1/2]

template<class T>

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

inline

Definition at line 691 of file ap.h.

{
if( this==&rhs )
return *this;
m_iLow = rhs.m_iLow;
m_iHigh = rhs.m_iHigh;
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_1d_array & ap::template_1d_array< T >::operator= | ( | const template_1d_array< T > & | rhs | ) |

inline

Definition at line 700 of file svd_si.h.

{
if( this==&rhs )
return *this;
m_iLow = rhs.m_iLow;
m_iHigh = rhs.m_iHigh;
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_1d_array< T >::setbounds | ( | int | iLow,
|  | int | iHigh )

inline

Definition at line 735 of file ap.h.

{
if(m_Vec)
delete[] m_Vec;
m_iLow = iLow;
m_iHigh = iHigh;
m_iVecSize = iHigh-iLow+1;
m_Vec = new T[m_iVecSize];
};

## setbounds() [2/2]

template<class T>

void ap::template_1d_array< T >::setbounds | ( | int | iLow,
|  | int | iHigh )

inline

Definition at line 744 of file svd_si.h.

{
if(m_Vec)
delete[] m_Vec;
m_iLow = iLow;
m_iHigh = iHigh;
m_iVecSize = iHigh-iLow+1;
m_Vec = new T[m_iVecSize];
};

## setcontent() [1/2]

template<class T>

void ap::template_1d_array< T >::setcontent | ( | int | iLow,
|  | int | iHigh,
|  | const T * | pContent )

inline

Definition at line 746 of file ap.h.

{
setbounds(iLow, iHigh);
for(int i=iLow; i<=iHigh; i++)
(*this)(i) = pContent[i-iLow];
};
ap::template_1d_array::setbounds
void setbounds(int iLow, int iHigh)
Definition ap.h:735

## setcontent() [2/2]

template<class T>

void ap::template_1d_array< T >::setcontent | ( | int | iLow,
|  | int | iHigh,
|  | const T * | pContent )

inline

Definition at line 755 of file svd_si.h.

{
setbounds(iLow, iHigh);
for(int i=iLow; i<=iHigh; i++)
(*this)(i) = pContent[i-iLow];
};

## wrongIdx() [1/2]

template<class T>

bool ap::template_1d_array< T >::wrongIdx | ( | int | i | ) | const

inline private

Definition at line 793 of file ap.h.

{ return i<m_iLow || i>m_iHigh; };

## wrongIdx() [2/2]

template<class T>

bool ap::template_1d_array< T >::wrongIdx | ( | int | i | ) | const

inline private

Definition at line 802 of file svd_si.h.

{ return i<m_iLow || i>m_iHigh; };

## Field Documentation

## m_iHigh

template<class T>

long ap::template_1d_array< T >::m_iHigh

private

Definition at line 797 of file ap.h.

## m_iLow

template<class T>

long ap::template_1d_array< T >::m_iLow

private

Definition at line 797 of file ap.h.

## m_iVecSize

template<class T>

long ap::template_1d_array< T >::m_iVecSize

private

Definition at line 796 of file ap.h.

## m_Vec

template<class T>

T * ap::template_1d_array< T >::m_Vec

private

Definition at line 795 of file ap.h.

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

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