Lines Matching full:matrix

65  * Sequence/Matrix Library
90 /* This matrix is a reference to another matrix. */
100 /* An element in a matrix. */
103 /* Matrix. */
122 /* The number of rows in the matrix. */
125 /* The number of columns in the matrix. */
134 /* The matrix data buffer. */
146 * Functions/macros for matrix class.
150 #define jas_matrix_numrows(matrix) \ argument
151 ((matrix)->numrows_)
154 #define jas_matrix_numcols(matrix) \ argument
155 ((matrix)->numcols_)
157 /* Get a matrix element. */
158 #define jas_matrix_get(matrix, i, j) \ argument
159 ((matrix)->rows_[i][j])
161 /* Set a matrix element. */
162 #define jas_matrix_set(matrix, i, j, v) \ argument
163 ((matrix)->rows_[i][j] = (v))
165 /* Get an element from a matrix that is known to be a row or column vector. */
166 #define jas_matrix_getv(matrix, i) \ argument
167 (((matrix)->numrows_ == 1) ? ((matrix)->rows_[0][i]) : \
168 ((matrix)->rows_[i][0]))
170 /* Set an element in a matrix that is known to be a row or column vector. */
171 #define jas_matrix_setv(matrix, i, v) \ argument
172 (((matrix)->numrows_ == 1) ? ((matrix)->rows_[0][i] = (v)) : \
173 ((matrix)->rows_[i][0] = (v)))
175 /* Get the address of an element in a matrix. */
176 #define jas_matrix_getref(matrix, i, j) \ argument
177 (&(matrix)->rows_[i][j])
179 #define jas_matrix_getvref(matrix, i) \ argument
180 (((matrix)->numrows_ > 1) ? jas_matrix_getref(matrix, i, 0) : jas_matrix_getref(matrix, 0, i))
182 #define jas_matrix_length(matrix) \ argument
183 (max((matrix)->numrows_, (matrix)->numcols_))
185 /* Create a matrix with the specified dimensions. */
188 /* Destroy a matrix. */
189 void jas_matrix_destroy(jas_matrix_t *matrix);
191 /* Resize a matrix. The previous contents of the matrix are lost. */
192 int jas_matrix_resize(jas_matrix_t *matrix, int numrows, int numcols);
194 int jas_matrix_output(jas_matrix_t *matrix, FILE *out);
196 /* Create a matrix that references part of another matrix. */
200 /* Create a matrix that is a reference to a row of another matrix. */
204 /* Create a matrix that is a reference to a column of another matrix. */
208 /* Clip the values of matrix elements to the specified range. */
209 void jas_matrix_clip(jas_matrix_t *matrix, jas_seqent_t minval,
212 /* Arithmetic shift left of all elements in a matrix. */
213 void jas_matrix_asl(jas_matrix_t *matrix, int n);
215 /* Arithmetic shift right of all elements in a matrix. */
216 void jas_matrix_asr(jas_matrix_t *matrix, int n);
218 /* Almost-but-not-quite arithmetic shift right of all elements in a matrix. */
219 void jas_matrix_divpow2(jas_matrix_t *matrix, int n);
221 /* Set all elements of a matrix to the specified value. */
222 void jas_matrix_setall(jas_matrix_t *matrix, jas_seqent_t val);
224 /* The spacing between rows of a matrix. */
225 #define jas_matrix_rowstep(matrix) \ argument
226 (((matrix)->numrows_ > 1) ? ((matrix)->rows_[1] - (matrix)->rows_[0]) : (0))
228 /* The spacing between columns of a matrix. */
229 #define jas_matrix_step(matrix) \ argument
230 (((matrix)->numrows_ > 1) ? (jas_matrix_rowstep(matrix)) : (1))