55 std::memcpy((
void *)&this->a_no_check(0,0),
57 this->num_rows()*this->num_columns()*
sizeof(T)
61 for (
int i = 0; i < this->num_rows(); ++i)
62 for (
int j = 0; j < this->num_columns(); ++j)
104 for (q=0; q<(copy_r*new_cols*
sizeof(T)); q++)
105 ((
char *)this->
p_memory)[q] = ((
char *)old_vals)[q];
109 if (new_rows > copy_r)
113 for (q=0; q<(new_rows-copy_r)*new_cols*
sizeof(T); q++)
118 for(j=0; j<new_cols; j++)
119 for(i=copy_r; i<new_rows; i++)
134 old_row_step, old_column_step,
140 for(i=0; i<copy_r; i++)
141 for(j=copy_c; j<new_cols; j++)
144 if (new_rows > copy_r)
148 for (q=0; q<((new_rows-copy_r)*new_cols*
sizeof(T)); q++)
153 for(j=0; j<new_cols; j++)
154 for(i=copy_r; i<new_rows; i++)
165 if (old_vals && old_vals != this->
p_memory)
166 delete [] (old_vals-old_offset);
Template Matrix class. This is an extension of the EST_TVector class to two dimensions.
ssize_t num_columns() const
return number of columns
ssize_t num_rows() const
return number of rows
EST_TSimpleMatrix(void)
default constructor
const EST_DMatrix * def_val
void just_resize(ssize_t new_rows, ssize_t new_cols, T **old_vals)
resize the memory and reset the bounds, but don't set values.
void copy(const EST_TSimpleMatrix< T > &a)
copy one matrix into another
void copy_data(const EST_TSimpleMatrix< T > &a)
void resize(ssize_t rows, ssize_t cols, ssize_t set=1)
INLINE const T & a_no_check(ssize_t row, ssize_t col) const
const access with no bounds check, care recommend
void set_values(const T *data, ssize_t r_step, ssize_t c_step, ssize_t start_r, ssize_t num_r, ssize_t start_c, ssize_t num_c)
Get and set values from array.
void resize(int rows, int cols, int set=1)
resize matrix
A subclass of EST_TMatrix which copies using memcopy.
ssize_t p_offset
How to access the memory.
ssize_t p_row_step
How to access the memory.
EST_TSimpleMatrix< T > & operator=(const EST_TSimpleMatrix< T > &s)
assignment operator