43 #include "EST_TSimpleMatrix.h"
44 #include "EST_TVector.h"
47 #include "EST_cutils.h"
54 if (!a.p_sub_matrix && !this->p_sub_matrix)
55 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)
88 int old_offset = this->p_offset;
92 new_rows = this->num_rows();
94 new_cols = this->num_columns();
98 if (!this->p_sub_matrix && new_cols == this->num_columns() && new_rows != this->num_rows())
100 int copy_r = Lof(this->num_rows(), new_rows);
102 this->just_resize(new_rows, new_cols, &old_vals);
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)
111 if (*this->def_val == 0)
113 for (q=0; q<(new_rows-copy_r)*new_cols*
sizeof(T); q++)
114 ((
char *)(this->p_memory + copy_r*this->p_row_step))[q] = 0;
118 for(j=0; j<new_cols; j++)
119 for(i=copy_r; i<new_rows; i++)
120 this->a_no_check(i,j) = *this->def_val;
124 else if (!this->p_sub_matrix)
126 int old_row_step = this->p_row_step;
127 int old_column_step = this->p_column_step;
128 int copy_r = Lof(this->num_rows(), new_rows);
129 int copy_c = Lof(this->num_columns(), new_cols);
131 this->just_resize(new_rows, new_cols, &old_vals);
133 this->set_values(old_vals,
134 old_row_step, old_column_step,
140 for(i=0; i<copy_r; i++)
141 for(j=copy_c; j<new_cols; j++)
142 this->a_no_check(i,j) = *this->def_val;
144 if (new_rows > copy_r)
146 if (*this->def_val == 0)
148 for (q=0; q<((new_rows-copy_r)*new_cols*
sizeof(T)); q++)
149 ((
char *)(this->p_memory + copy_r*this->p_row_step))[q] = 0;
153 for(j=0; j<new_cols; j++)
154 for(i=copy_r; i<new_rows; i++)
155 this->a_no_check(i,j) = *this->def_val;
165 if (old_vals && old_vals != this->p_memory)
166 delete [] (old_vals-old_offset);