~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/math/matrix/mat_fill.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)Fill Matrix (gets full copies of a matrix)
  2  * @(#)(slowest possible implementation (wts)
  3  */
  4 
  5 #include <tina/sys.h>
  6 #include <tina/math.h>
  7 
  8 double  matrix_getf();
  9 void    matrix_putf();
 10 Matrix *matrix_alloc();
 11 
 12 Matrix *matrix_fill(Matrix * mat)
 13 {
 14     Matrix *full;
 15     int     n, m;
 16     int     i, j;
 17 
 18     if (mat == NULL)
 19         return (NULL);
 20 
 21     m = mat->m;
 22     n = mat->n;
 23     full = matrix_alloc(m, n, matrix_full, mat->vtype);
 24 
 25     if (full == NULL)
 26         return (NULL);
 27 
 28     for (i = 0; i < m; ++i)
 29         for (j = 0; j < n; ++j)
 30             matrix_putf(matrix_getf(mat, i, j), full, i, j);
 31     return (full);
 32 }
 33 
 34 Matrix *matrix_cast_fill(Matrix * mat, Vartype vtype)
 35 {
 36     Matrix *full;
 37     int     n, m;
 38     int     i, j;
 39 
 40     if (mat == NULL)
 41         return (NULL);
 42 
 43     m = mat->m;
 44     n = mat->n;
 45     full = matrix_alloc(m, n, matrix_full, vtype);
 46 
 47     if (full == NULL)
 48         return (NULL);
 49 
 50     for (i = 0; i < m; ++i)
 51         for (j = 0; j < n; ++j)
 52             matrix_putf(matrix_getf(mat, i, j), full, i, j);
 53     return (full);
 54 }
 55 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.