1 /**********************************************************************/
2 /* The functions below are obsolete */
3 /**********************************************************************/
6 FUNCTION (gsl_matrix, get_row) (TYPE (gsl_vector) * v,
7 const TYPE (gsl_matrix) * m,
10 const size_t M = m->size1;
11 const size_t N = m->size2;
12 const size_t tda = m->tda;
16 GSL_ERROR ("row index is out of range", GSL_EINVAL);
21 GSL_ERROR ("matrix row size and vector length are not equal",
26 ATOMIC *v_data = v->data;
27 const ATOMIC *row_data = m->data + MULTIPLICITY * i * tda;
28 const size_t stride = v->stride ;
31 for (j = 0; j < N; j++)
35 for (k = 0; k < MULTIPLICITY; k++)
37 v_data[MULTIPLICITY * stride * j + k]
38 = row_data[MULTIPLICITY * j + k];
47 FUNCTION (gsl_matrix, get_col) (TYPE (gsl_vector) * v,
48 const TYPE (gsl_matrix) * m,
51 const size_t M = m->size1;
52 const size_t N = m->size2;
53 const size_t tda = m->tda;
57 GSL_ERROR ("column index is out of range", GSL_EINVAL);
62 GSL_ERROR ("matrix column size and vector length are not equal",
68 ATOMIC *v_data = v->data;
69 const ATOMIC *column_data = m->data + MULTIPLICITY * j;
70 const size_t stride = v->stride ;
73 for (i = 0; i < M; i++)
77 for (k = 0; k < MULTIPLICITY; k++)
79 v_data[stride * MULTIPLICITY * i + k] =
80 column_data[MULTIPLICITY * i * tda + k];
89 FUNCTION (gsl_matrix, set_row) (TYPE (gsl_matrix) * m,
91 const TYPE (gsl_vector) * v)
93 const size_t M = m->size1;
94 const size_t N = m->size2;
95 const size_t tda = m->tda;
99 GSL_ERROR ("row index is out of range", GSL_EINVAL);
104 GSL_ERROR ("matrix row size and vector length are not equal",
109 const ATOMIC *v_data = v->data;
110 ATOMIC *row_data = m->data + MULTIPLICITY * i * tda;
111 const size_t stride = v->stride ;
114 for (j = 0; j < N; j++)
118 for (k = 0; k < MULTIPLICITY; k++)
120 row_data[MULTIPLICITY*j + k]
121 = v_data[MULTIPLICITY * stride * j + k];
130 FUNCTION (gsl_matrix, set_col) (TYPE (gsl_matrix) * m,
132 const TYPE (gsl_vector) * v)
134 const size_t M = m->size1;
135 const size_t N = m->size2;
136 const size_t tda = m->tda;
140 GSL_ERROR ("column index is out of range", GSL_EINVAL);
145 GSL_ERROR ("matrix column size and vector length are not equal",
150 const ATOMIC *v_data = v->data;
151 ATOMIC *column_data = m->data + MULTIPLICITY * j;
152 const size_t stride = v->stride ;
155 for (i = 0; i < M; i++)
159 for (k = 0; k < MULTIPLICITY; k++)
161 column_data[MULTIPLICITY * i * tda + k]
162 = v_data[MULTIPLICITY * stride * i + k];
172 FUNCTION (gsl_vector, alloc_row_from_matrix) (TYPE(gsl_matrix) * m,
175 TYPE (gsl_vector) * v;
177 const size_t M = m->size1;
181 GSL_ERROR_VAL ("row index is out of range", GSL_EINVAL, 0);
184 v = (TYPE (gsl_vector) *) malloc (sizeof (TYPE (gsl_vector)));
188 GSL_ERROR_VAL ("failed to allocate space for vector struct",
192 v->data = m->data + MULTIPLICITY * i * m->tda ;
201 FUNCTION (gsl_vector, alloc_col_from_matrix) (TYPE(gsl_matrix) * m,
204 TYPE (gsl_vector) * v;
206 const size_t N = m->size2;
210 GSL_ERROR_VAL ("column index is out of range", GSL_EINVAL, 0);
213 v = (TYPE (gsl_vector) *) malloc (sizeof (TYPE (gsl_vector)));
217 GSL_ERROR_VAL ("failed to allocate space for vector struct",
221 v->data = m->data + MULTIPLICITY * j ;