1 #include <../../nrnconf.h> 33 static char rcsid[] =
"submat.c,v 1.1 1997/12/04 17:55:55 hines Exp";
48 if ( vec==(
VEC *)NULL || vec->
dim<mat->
m )
51 for ( i=0; i<mat->
m; i++ )
52 vec->
ve[i] = mat->
me[i][col];
69 if ( vec==(
VEC *)NULL || vec->
dim<mat->
n )
72 for ( i=0; i<mat->
n; i++ )
91 for ( i=i0; i<lim; i++ )
92 mat->
me[i][col] = vec->
ve[i];
110 for ( j=j0; j<lim; j++ )
122 u_int row1,col1,row2,col2;
128 if ( row1 > row2 || col1 > col2 || row2 >= old->
m || col2 >= old->
n )
130 if (
new==(
MAT *)NULL || new->
m < row2-row1+1 )
134 if (
new==(
MAT *)NULL || new->
me==(
Real **)NULL )
138 (row2-row1+1)*
sizeof(
Real *));
142 new->m = row2-row1+1;
144 new->n = col2-col1+1;
146 new->base = (
Real *)NULL;
148 for ( i=0; i <
new->m; i++ )
149 new->
me[i] = (old->
me[i+row1]) + col1;
163 if ( i1 > i2 || old->
dim < i2 )
166 if (
new == (
VEC *)NULL )
168 if (
new == (
VEC *)NULL )
175 new->dim = i2 - i1 + 1;
176 new->ve = &(old->
ve[i1]);
MAT * sub_mat(MAT *old, u_int row1, u_int col1, u_int row2, u_int col2, MAT *new)
static Object ** v_resize(void *v)
MAT * _set_col(MAT *mat, u_int col, VEC *vec, u_int i0)
VEC * get_col(MAT *mat, u_int col, VEC *vec)
#define mem_bytes(type, old_size, new_size)
VEC * sub_vec(VEC *old, int i1, int i2, VEC *new)
VEC * get_row(MAT *mat, u_int row, VEC *vec)
MAT * _set_row(MAT *mat, u_int row, VEC *vec, u_int j0)
#define error(err_num, fn_name)