changeset 1320:c9aecc02c6d4

[project @ 1995-08-22 04:10:01 by jwe]
author jwe
date Tue, 22 Aug 1995 04:10:01 +0000
parents 1270bf19f7fe
children 64819a909ed7
files src/pt-const.cc
diffstat 1 files changed, 35 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/pt-const.cc	Tue Aug 22 00:43:02 1995 +0000
+++ b/src/pt-const.cc	Tue Aug 22 04:10:01 1995 +0000
@@ -4582,13 +4582,29 @@
       if (rhs.const_type () == matrix_constant)
 	{
 	  double *cop_out = rhs_m.fortran_vec ();
-	  for (int k = 0; k < len; k++)
+
+	  if (type_tag == matrix_constant)
 	    {
-	      int ii = fortran_row (i.elem (k) + 1, nr) - 1;
-	      int jj = fortran_column (i.elem (k) + 1, nr) - 1;
-
-	      matrix->elem (ii, jj) = *cop_out++;
+	      for (int k = 0; k < len; k++)
+		{
+		  int ii = fortran_row (i.elem (k) + 1, nr) - 1;
+		  int jj = fortran_column (i.elem (k) + 1, nr) - 1;
+
+		  matrix->elem (ii, jj) = *cop_out++;
+		}
 	    }
+	  else if (type_tag == complex_matrix_constant)
+	    {
+	      for (int k = 0; k < len; k++)
+		{
+		  int ii = fortran_row (i.elem (k) + 1, nr) - 1;
+		  int jj = fortran_column (i.elem (k) + 1, nr) - 1;
+
+		  complex_matrix->elem (ii, jj) = *cop_out++;
+		}
+	    }
+	  else
+	    panic_impossible ();
 	}
       else
 	{
@@ -4640,9 +4656,20 @@
   if (rhs.const_type () == matrix_constant)
     {
       double *cop_out = rhs_m.fortran_vec ();
-      for (int j = 0; j < nc; j++)
-	for (int i = 0; i < nr; i++)
-	  matrix->elem (i, j) = *cop_out++;
+      if (type_tag == matrix_constant)
+	{
+	  for (int j = 0; j < nc; j++)
+	    for (int i = 0; i < nr; i++)
+	      matrix->elem (i, j) = *cop_out++;
+	}
+      else if (type_tag == complex_matrix_constant)
+	{
+	  for (int j = 0; j < nc; j++)
+	    for (int i = 0; i < nr; i++)
+	      complex_matrix->elem (i, j) = *cop_out++;
+	}
+      else
+	panic_impossible ();
     }
   else
     {