Mercurial > octave
comparison src/load-save.cc @ 1275:d607adf5af66
[project @ 1995-04-21 19:59:03 by jwe]
author | jwe |
---|---|
date | Fri, 21 Apr 1995 19:59:03 +0000 |
parents | 2457d4ba0691 |
children | b4586d676b7f |
comparison
equal
deleted
inserted
replaced
1274:305162358727 | 1275:d607adf5af66 |
---|---|
1291 } | 1291 } |
1292 else if (strncmp (ptr, "matrix", 6) == 0) | 1292 else if (strncmp (ptr, "matrix", 6) == 0) |
1293 { | 1293 { |
1294 int nr = 0, nc = 0; | 1294 int nr = 0, nc = 0; |
1295 | 1295 |
1296 if (extract_keyword (is, "rows", nr) && nr > 0 | 1296 if (extract_keyword (is, "rows", nr) && nr >= 0 |
1297 && extract_keyword (is, "columns", nc) && nc > 0) | 1297 && extract_keyword (is, "columns", nc) && nc >= 0) |
1298 { | 1298 { |
1299 Matrix tmp (nr, nc); | 1299 if (nr > 0 && nc > 0) |
1300 is >> tmp; | 1300 { |
1301 if (is) | 1301 Matrix tmp (nr, nc); |
1302 tc = tmp; | 1302 is >> tmp; |
1303 if (is) | |
1304 tc = tmp; | |
1305 else | |
1306 error ("load: failed to load matrix constant"); | |
1307 } | |
1308 else if (nr == 0 || nc == 0) | |
1309 tc = Matrix (nr, nc); | |
1303 else | 1310 else |
1304 error ("load: failed to load matrix constant"); | 1311 panic_impossible (); |
1305 } | 1312 } |
1306 else | 1313 else |
1307 error ("load: failed to extract number of rows and columns"); | 1314 error ("load: failed to extract number of rows and columns"); |
1308 } | 1315 } |
1309 else if (strncmp (ptr, "complex scalar", 14) == 0) | 1316 else if (strncmp (ptr, "complex scalar", 14) == 0) |